Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Using Table. #516

Closed
liderako opened this issue Sep 28, 2017 · 17 comments
Closed

Using Table. #516

liderako opened this issue Sep 28, 2017 · 17 comments
Milestone

Comments

@liderako
Copy link

I have two contracts.

First - player -( this is contract, creates table and init variable "name" and win = 0.

Second contract -mydice- must change variables in table accounts which contain variables.

The contract player can change itself. But contract number two can not change table in accounts.

@bytemaster
Copy link
Contributor

Post a github repo link rather than .tar.gz

@liderako
Copy link
Author

liderako commented Oct 5, 2017

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@liderako
Copy link
Author

liderako commented Oct 6, 2017

@learnforpractice
I delete code in player.hpp

    requireNotice( name );
    requireAuth( name );

And add code in mydice.cpp
requireAuth( N(mydice) );

It did not help(

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@liderako
Copy link
Author

liderako commented Oct 6, 2017

@learnforpractice
Commands and output on eosc.
log.txt

@liderako
Copy link
Author

liderako commented Oct 6, 2017

player variable had to be changed to 1.

@liderako
Copy link
Author

liderako commented Oct 6, 2017

@learnforpractice
never mind if, i use one wallet and one pair keys?

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@liderako
Copy link
Author

liderako commented Oct 6, 2017

Now mydice once changes the value in the table and does not want to anymore=)
But already thanks.

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@liderako
Copy link
Author

liderako commented Oct 6, 2017

Could you try to run it more than once?

@liderako
Copy link
Author

liderako commented Oct 6, 2017

The "win" variable need to become greater then 1

@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 6, 2017 via email

@liderako
Copy link
Author

liderako commented Oct 6, 2017

I found an error.
I use Accounts::get(owner, owner, N( account ), &account, sizeof(account) );
but need
Accounts::get(owner, currentCode(), N( account ), &account, sizeof(account) );.
Thanks

@liderako liderako closed this as completed Oct 6, 2017
@learnforpractice
Copy link
Contributor

learnforpractice commented Oct 7, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants