lamports -> lamports() (#16915)
This commit is contained in:
parent
b5d30846d6
commit
82e11588a5
|
@ -17,7 +17,7 @@ use solana_ledger::{
|
||||||
};
|
};
|
||||||
use solana_runtime::hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE;
|
use solana_runtime::hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
account::{Account, AccountSharedData, WritableAccount},
|
account::{Account, AccountSharedData, ReadableAccount, WritableAccount},
|
||||||
clock,
|
clock,
|
||||||
epoch_schedule::EpochSchedule,
|
epoch_schedule::EpochSchedule,
|
||||||
fee_calculator::FeeRateGovernor,
|
fee_calculator::FeeRateGovernor,
|
||||||
|
@ -92,7 +92,7 @@ pub fn load_genesis_accounts(file: &str, genesis_config: &mut GenesisConfig) ->
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
account.set_executable(account_details.executable);
|
account.set_executable(account_details.executable);
|
||||||
lamports += account.lamports;
|
lamports += account.lamports();
|
||||||
genesis_config.add_account(pubkey, account);
|
genesis_config.add_account(pubkey, account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2101,7 +2101,7 @@ fn main() {
|
||||||
for (pubkey, (account, slot)) in accounts.into_iter() {
|
for (pubkey, (account, slot)) in accounts.into_iter() {
|
||||||
let data_len = account.data().len();
|
let data_len = account.data().len();
|
||||||
println!("{}:", pubkey);
|
println!("{}:", pubkey);
|
||||||
println!(" - balance: {} SOL", lamports_to_sol(account.lamports));
|
println!(" - balance: {} SOL", lamports_to_sol(account.lamports()));
|
||||||
println!(" - owner: '{}'", account.owner());
|
println!(" - owner: '{}'", account.owner());
|
||||||
println!(" - executable: {}", account.executable());
|
println!(" - executable: {}", account.executable());
|
||||||
println!(" - slot: {}", slot);
|
println!(" - slot: {}", slot);
|
||||||
|
@ -2441,7 +2441,7 @@ fn main() {
|
||||||
account,
|
account,
|
||||||
base_bank
|
base_bank
|
||||||
.get_account(&pubkey)
|
.get_account(&pubkey)
|
||||||
.map(|a| a.lamports)
|
.map(|a| a.lamports())
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -2451,7 +2451,7 @@ fn main() {
|
||||||
(
|
(
|
||||||
*account.owner(),
|
*account.owner(),
|
||||||
*base_lamports,
|
*base_lamports,
|
||||||
account.lamports - base_lamports,
|
account.lamports() - base_lamports,
|
||||||
*pubkey,
|
*pubkey,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -2469,7 +2469,7 @@ fn main() {
|
||||||
.map(|pubkey| (**pubkey, warped_bank.get_account(pubkey).unwrap()))
|
.map(|pubkey| (**pubkey, warped_bank.get_account(pubkey).unwrap()))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
unchanged_accounts.sort_unstable_by_key(|(pubkey, account)| {
|
unchanged_accounts.sort_unstable_by_key(|(pubkey, account)| {
|
||||||
(*account.owner(), account.lamports, *pubkey)
|
(*account.owner(), account.lamports(), *pubkey)
|
||||||
});
|
});
|
||||||
let unchanged_accounts = unchanged_accounts.into_iter();
|
let unchanged_accounts = unchanged_accounts.into_iter();
|
||||||
|
|
||||||
|
@ -2486,14 +2486,14 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(base_account) = base_bank.get_account(&pubkey) {
|
if let Some(base_account) = base_bank.get_account(&pubkey) {
|
||||||
let delta = warped_account.lamports - base_account.lamports;
|
let delta = warped_account.lamports() - base_account.lamports();
|
||||||
let detail = stake_calcuration_details.get(&pubkey);
|
let detail = stake_calcuration_details.get(&pubkey);
|
||||||
println!(
|
println!(
|
||||||
"{:<45}({}): {} => {} (+{} {:>4.9}%) {:?}",
|
"{:<45}({}): {} => {} (+{} {:>4.9}%) {:?}",
|
||||||
format!("{}", pubkey), // format! is needed to pad/justify correctly.
|
format!("{}", pubkey), // format! is needed to pad/justify correctly.
|
||||||
base_account.owner(),
|
base_account.owner(),
|
||||||
Sol(base_account.lamports),
|
Sol(base_account.lamports()),
|
||||||
Sol(warped_account.lamports),
|
Sol(warped_account.lamports()),
|
||||||
Sol(delta),
|
Sol(delta),
|
||||||
((warped_account.lamports() as f64)
|
((warped_account.lamports() as f64)
|
||||||
/ (base_account.lamports() as f64)
|
/ (base_account.lamports() as f64)
|
||||||
|
@ -2555,8 +2555,8 @@ fn main() {
|
||||||
rewarded_epoch: base_bank.epoch(),
|
rewarded_epoch: base_bank.epoch(),
|
||||||
account: format!("{}", pubkey),
|
account: format!("{}", pubkey),
|
||||||
owner: format!("{}", base_account.owner()),
|
owner: format!("{}", base_account.owner()),
|
||||||
old_balance: base_account.lamports,
|
old_balance: base_account.lamports(),
|
||||||
new_balance: warped_account.lamports,
|
new_balance: warped_account.lamports(),
|
||||||
data_size: base_account.data().len(),
|
data_size: base_account.data().len(),
|
||||||
delegation: format_or_na(detail.map(|d| d.voter)),
|
delegation: format_or_na(detail.map(|d| d.voter)),
|
||||||
delegation_owner: format_or_na(
|
delegation_owner: format_or_na(
|
||||||
|
|
|
@ -344,7 +344,7 @@ impl solana_sdk::program_stubs::SyscallStubs for SyscallStubs {
|
||||||
for account_info in account_infos {
|
for account_info in account_infos {
|
||||||
if account_info.unsigned_key() == account_pubkey {
|
if account_info.unsigned_key() == account_pubkey {
|
||||||
let account = &accounts[i];
|
let account = &accounts[i];
|
||||||
**account_info.try_borrow_mut_lamports().unwrap() = account.borrow().lamports;
|
**account_info.try_borrow_mut_lamports().unwrap() = account.borrow().lamports();
|
||||||
|
|
||||||
let mut data = account_info.try_borrow_mut_data()?;
|
let mut data = account_info.try_borrow_mut_data()?;
|
||||||
let account_borrow = account.borrow();
|
let account_borrow = account.borrow();
|
||||||
|
|
|
@ -1992,7 +1992,7 @@ fn call<'a>(
|
||||||
let account = account.borrow();
|
let account = account.borrow();
|
||||||
if let Some(mut account_ref) = account_ref {
|
if let Some(mut account_ref) = account_ref {
|
||||||
if message.is_writable(i, demote_sysvar_write_locks) && !account.executable() {
|
if message.is_writable(i, demote_sysvar_write_locks) && !account.executable() {
|
||||||
*account_ref.lamports = account.lamports;
|
*account_ref.lamports = account.lamports();
|
||||||
*account_ref.owner = *account.owner();
|
*account_ref.owner = *account.owner();
|
||||||
if account_ref.data.len() != account.data().len() {
|
if account_ref.data.len() != account.data().len() {
|
||||||
if !account_ref.data.is_empty() {
|
if !account_ref.data.is_empty() {
|
||||||
|
|
Loading…
Reference in New Issue