plumb some rent (#5610)

* plumb some rent

* nits

* fixups

* fixups

* fixups
This commit is contained in:
Rob Walker
2019-08-23 14:04:53 -07:00
committed by GitHub
parent 9b8d59d2e9
commit 0ffe7a9c8f
19 changed files with 385 additions and 143 deletions

View File

@@ -1,4 +1,5 @@
use crate::pubkey::Pubkey;
use crate::Epoch;
use std::{cmp, fmt};
/// An Account with data that is stored on chain
@@ -13,6 +14,8 @@ pub struct Account {
pub owner: Pubkey,
/// this account's data contains a loaded program (and is now read-only)
pub executable: bool,
/// the epoch at which this account will next owe rent
pub rent_epoch: Epoch,
}
impl fmt::Debug for Account {
@@ -25,11 +28,12 @@ impl fmt::Debug for Account {
};
write!(
f,
"Account {{ lamports: {} data.len: {} owner: {} executable: {}{} }}",
"Account {{ lamports: {} data.len: {} owner: {} executable: {} rent_epoch: {}{} }}",
self.lamports,
self.data.len(),
self.owner,
self.executable,
self.rent_epoch,
data_str,
)
}
@@ -42,7 +46,7 @@ impl Account {
lamports,
data: vec![0u8; space],
owner: *owner,
executable: false,
..Account::default()
}
}
@@ -56,7 +60,7 @@ impl Account {
lamports,
data,
owner: *owner,
executable: false,
..Account::default()
})
}