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

Add ability to access account info #55

Open
acheroncrypto opened this issue Nov 20, 2022 · 3 comments
Open

Add ability to access account info #55

acheroncrypto opened this issue Nov 20, 2022 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@acheroncrypto
Copy link
Contributor

We can access the public key of the account with .key() but not the other properties. It would be great to have access to the remaining properties.

pub struct AccountInfo<'a> {
    pub key: &'a Pubkey,
    pub is_signer: bool,
    pub is_writable: bool,
    pub lamports: Rc<RefCell<&'a mut u64>>,
    pub data: Rc<RefCell<&'a mut [u8]>>,
    pub owner: &'a Pubkey,
    pub executable: bool,
    pub rent_epoch: u64,
}  
@ameliatastic ameliatastic moved this to Todo in Seahorse Nov 21, 2022
@ameliatastic ameliatastic added enhancement New feature or request good first issue Good for newcomers labels Nov 21, 2022
@ameliatastic
Copy link
Owner

ameliatastic commented Nov 21, 2022

Looks feasible to add (at least most of) these fields! Definitely something that people are going to need to be able to access in the future, when programs start getting more complex.

@KopylovVadik
Copy link

Hello everyone, I can do this, can I know the path to the file?

@ameliatastic
Copy link
Owner

Check src/core/compile/builtin/prelude.rs, pretty much everything account-related is implemented there. I think you only need to touch that to add these features, you can read my overview here for more detail if you need!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

3 participants