Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typedContract generation #1

Open
nicolad opened this issue Feb 15, 2023 · 9 comments
Open

typedContract generation #1

nicolad opened this issue Feb 15, 2023 · 9 comments

Comments

@nicolad
Copy link

nicolad commented Feb 15, 2023

@niklabh how this folder was generated?

https://github.com/AstarNetwork/wasm-lottery/tree/master/src/typedContract

@niklabh
Copy link
Collaborator

niklabh commented Feb 15, 2023

This was generate using typechain

With command:

swanky contract compile lottery -v

@nicolad
Copy link
Author

nicolad commented Feb 15, 2023

thank you @niklabh

@nicolad nicolad closed this as completed Feb 15, 2023
@nicolad
Copy link
Author

nicolad commented Feb 15, 2023

@niklabh getting this error

image

@nicolad nicolad reopened this Feb 15, 2023
@nicolad
Copy link
Author

nicolad commented Feb 15, 2023

fixed that, now getting this

image

@niklabh
Copy link
Collaborator

niklabh commented Feb 15, 2023

Contract is complied succefully. This error message can be ignored

@nicolad
Copy link
Author

nicolad commented Feb 15, 2023

thx @niklabh

@ganesh1997oli
Copy link

Hey @niklabh, I successfully compile and run it. I have one question. I am using wrapper wallet with the address display on dropdown field. But executing PLAY NOW function which enter users with different address as you can see players section. Why this is happening? What if I wan't to filter data based on user? Doesn't polkadotjs wrapper account address and added players address be same? This seems work on polkadot js.

Screenshot_2023-02-16_at_08 39 06

@niklabh
Copy link
Collaborator

niklabh commented Feb 16, 2023

Even if the Address looks different it is the same. It is just formatted using different ss58 format. The error is coming from contract itself. For the contract the address public key matters not the address string. Public key will be the same fro wrapper wallet.

@ganesh1997oli
Copy link

@niklabh thanks for quick response. This is my function which returns todo_list of specific users who created them. But while creating todo list owner address format save different and doesn't match with caller in frontend and data doesn't display. How to solve this issue? Or am I doing something wrong?

pub fn get_todo_list(&self) -> Vec<TodoItem> {
            let caller = self.env().caller();
            let mut item: Vec<TodoItem> = Vec::new();
            for _item in 0..self.item_id {
                match self.item.get(_item) {
                    Some(value) => {
                        if value.owner == caller {
                            item.push(value);
                        }
                    }
                    None => (),
                }
            }
            item
        }

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

No branches or pull requests

3 participants