Tables Programming - Discussion

Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.

On the removeall ACTION. In EOS studio it compiles and deploy’s perfect. It also executes and comes back with Execution succeed. Transation id: xxxxxx but it does not do anything. It also does the same thing on the multiple accounts I created.

Is this the same for you?

Just to let you know there is a 404 page not found error on your dogcontract2.cpp link.
(and I am signed into github!)

i.e.

Part 3 - Test Driving our New Index

Complete Code: https://github.com/filipmartinsson/eos-programming/blob/master/Multi-Index-Table/src/dogcontract2.cpp

I should also say THANK YOU - your EOS class is a massive help to me!!!

I was trying to do it alone but the EOS documentation, examples and other internet resources are terrible!!! (although I did manage to write some contracts!).

Exactly the same for me, I think I mentioned it in the video. It runs fine but doesn’t have any effect. Seems to be a bug in EOS Studio. That’s why we move on to running our own node and use command line tools for EOS 201 course. Because studio is limited in it’s functionality.

I have fixed the github link now. Should work :slight_smile:

Thank you for your feedback on the course. It makes me happy to hear. Would you mine leaving a review on facebook with your thoughts? That helps us out a lot. https://www.facebook.com/ivanontech/reviews/

Got an error while running push action

Cleos push action cardgame insert ‘[“cardgame”,“cldog”,200]’ -p cardgame@active

Error 3120006: No available wallet

Ensure that you have created a wallet and have it open

Error Details:

You don’t have any wallet!

$ Cleos get table cardgame cardgame dogs
{
“rows”: [{
“id”: 0,
“dog_name”: “test name 3”,
“age”: 20,
“owner”: “sarada”
},{
“id”: 1,
“dog_name”: “test name 3”,
“age”: 19,
“owner”: “echo”
},{
“id”: 2,
“dog_name”: “test name 4”,
“age”: 5,
“owner”: “sarada”
}
],
“more”: false
}

what happened to id = 0 , why didn’t it fetch ?

$ Cleos get table cardgame cardgame dogs --index 2 --key-type name -L “sarada” -U “sarada”
{
“rows”: [{
“id”: 2,
“dog_name”: “test name 4”,
“age”: 5,
“owner”: “sarada”
}
],
“more”: false
}

You need to create a wallet, and it needs to be unlocked. Did you figure it out?

1 Like

Did you have dog nr 0 in the table before you created the second index? Try to empty the table all together and then add them all again.

could your give a brief meaning of the statement

Using contract::contract;

Sure! This isn’t something eos specific, it’s standard c++. It allows us to use bring the constructor of the contract class into our class. This is important since we inherit from the contract class, we also want to have access to its constructor to initialize the contract.

Here is a general description of the using keyword in c++.

A using declaration imports a name from another namespace into the current namespace. It can also be used to introduce a name into a class scope; this is most often used to promote the access level of an inherited member or bring an inherited member into the derived class for overload resolution.

Taken from https://www.oreilly.com/library/view/c-in-a/059600298X/re89.html.

@filip Just to let you that the link in the Multi-Index DB API reading assignment is broken:

It currently points back to the course directory, but from the teachable course I see that it should instead point to the EOSIO Dev documentation:

Thank you very much for pointing that out. I have fixed it now :slight_smile: