pub struct AccountData {
pub data: EncodedBinary,
pub executable: bool,
pub lamports: u64,
pub owner: Address,
pub space: u64,
}Expand description
An account’s full state, used as an account override.
On the wire: {"data": {"data": "<base64>", "encoding": "base64"}, "executable": false, "lamports": 1000000, "owner": "<base58>", "space": 0}.
- The override replaces the whole account. To change a token balance, build the token
account’s bytes with
token. rent_epochis not carried; the session sets it to 0.- Scheduled-action, depth and
simulateTransactionoverrides reject an executable account or one owned by a program loader: a program cannot be overridden this way.
Fields§
§data: EncodedBinaryAccount data bytes and encoding.
executable: boolWhether the account is executable.
lamports: u64Balance in lamports (1 SOL = 1,000,000,000 lamports).
owner: AddressThe owning program, base58.
space: u64The data length in bytes. Set it to the decoded length of data: the account’s size
comes from data, not from this field.
Implementations§
Source§impl AccountData
impl AccountData
Sourcepub fn to_account(&self) -> Result<Account, Base64DecodeError>
pub fn to_account(&self) -> Result<Account, Base64DecodeError>
The account these fields describe, with rent_epoch 0. Fails if data does not
decode.
Sourcepub fn system_account(lamports: u64) -> Self
pub fn system_account(lamports: u64) -> Self
A system-owned account with no data holding lamports. At 0 the account does not exist.
Trait Implementations§
Source§impl Clone for AccountData
impl Clone for AccountData
Source§impl Debug for AccountData
impl Debug for AccountData
Source§impl<'de> Deserialize<'de> for AccountData
impl<'de> Deserialize<'de> for AccountData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AccountData
Source§impl From<&Account> for AccountData
The wire form of account: base64 data, space = data.len(). The inverse of
AccountData::to_account; rent_epoch is dropped because the wire does not carry it.
impl From<&Account> for AccountData
The wire form of account: base64 data, space = data.len(). The inverse of
AccountData::to_account; rent_epoch is dropped because the wire does not carry it.