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

Why do we always pass env around? #18

Open
llllllluc opened this issue Oct 20, 2022 · 1 comment
Open

Why do we always pass env around? #18

llllllluc opened this issue Oct 20, 2022 · 1 comment

Comments

@llllllluc
Copy link
Contributor

env is always passed from execute and query to the specific execute / query functions, but barely used. Can we just skip passing env?

@0fatih
Copy link

0fatih commented Oct 23, 2022

We can not skip passing it. Because you have to comply with the interface. env includes:

pub struct Env { 
    pub block: BlockInfo, 
    pub transaction: Option<TransactionInfo>, 
    pub contract: ContractInfo,
}

If you wish, you can use them in your smart contract.

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

2 participants