This reverts commit 35d2a0fd69
.
This commit is contained in:
parent
82dd0eaf8b
commit
6c10515ccf
|
@ -60,8 +60,6 @@ struct DeserializableVersionedBank {
|
|||
unused_accounts: UnusedAccounts,
|
||||
epoch_stakes: HashMap<Epoch, EpochStakes>,
|
||||
is_delta: bool,
|
||||
#[serde(deserialize_with = "default_on_eof")]
|
||||
lamports_per_signature: u64,
|
||||
}
|
||||
|
||||
impl From<DeserializableVersionedBank> for BankFieldsToDeserialize {
|
||||
|
@ -90,9 +88,7 @@ impl From<DeserializableVersionedBank> for BankFieldsToDeserialize {
|
|||
collector_id: dvb.collector_id,
|
||||
collector_fees: dvb.collector_fees,
|
||||
fee_calculator: dvb.fee_calculator,
|
||||
fee_rate_governor: dvb
|
||||
.fee_rate_governor
|
||||
.clone_with_lamports_per_signature(dvb.lamports_per_signature),
|
||||
fee_rate_governor: dvb.fee_rate_governor,
|
||||
collected_rent: dvb.collected_rent,
|
||||
rent_collector: dvb.rent_collector,
|
||||
epoch_schedule: dvb.epoch_schedule,
|
||||
|
@ -141,12 +137,10 @@ struct SerializableVersionedBank<'a> {
|
|||
unused_accounts: UnusedAccounts,
|
||||
epoch_stakes: &'a HashMap<Epoch, EpochStakes>,
|
||||
is_delta: bool,
|
||||
lamports_per_signature: u64,
|
||||
}
|
||||
|
||||
impl<'a> From<crate::bank::BankFieldsToSerialize<'a>> for SerializableVersionedBank<'a> {
|
||||
fn from(rhs: crate::bank::BankFieldsToSerialize<'a>) -> Self {
|
||||
let lamports_per_signature = rhs.fee_rate_governor.lamports_per_signature;
|
||||
Self {
|
||||
blockhash_queue: rhs.blockhash_queue,
|
||||
ancestors: rhs.ancestors,
|
||||
|
@ -180,7 +174,6 @@ impl<'a> From<crate::bank::BankFieldsToSerialize<'a>> for SerializableVersionedB
|
|||
unused_accounts: UnusedAccounts::default(),
|
||||
epoch_stakes: rhs.epoch_stakes,
|
||||
is_delta: rhs.is_delta,
|
||||
lamports_per_signature,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -318,7 +311,6 @@ impl<'a> TypeContext<'a> for Context {
|
|||
let rhs = bank_fields;
|
||||
let blockhash_queue = RwLock::new(rhs.blockhash_queue.clone());
|
||||
let hard_forks = RwLock::new(rhs.hard_forks.clone());
|
||||
let lamports_per_signature = rhs.fee_rate_governor.lamports_per_signature;
|
||||
let bank = SerializableVersionedBank {
|
||||
blockhash_queue: &blockhash_queue,
|
||||
ancestors: &rhs.ancestors,
|
||||
|
@ -352,7 +344,6 @@ impl<'a> TypeContext<'a> for Context {
|
|||
unused_accounts: UnusedAccounts::default(),
|
||||
epoch_stakes: &rhs.epoch_stakes,
|
||||
is_delta: rhs.is_delta,
|
||||
lamports_per_signature,
|
||||
};
|
||||
|
||||
bincode::serialize_into(stream_writer, &(bank, accounts_db_fields))
|
||||
|
|
|
@ -367,7 +367,7 @@ mod test_bank_serialize {
|
|||
|
||||
// This some what long test harness is required to freeze the ABI of
|
||||
// Bank's serialization due to versioned nature
|
||||
#[frozen_abi(digest = "3PiYioYfEPzm2u64FZLsLx1SUTGE3NUvALXvwqhxZuRF")]
|
||||
#[frozen_abi(digest = "HT9yewU4zJ6ZAgJ7aDSbHPtzZGZqASpq6rkq6ET42Kki")]
|
||||
#[derive(Serialize, AbiExample)]
|
||||
pub struct BankAbiTestWrapperNewer {
|
||||
#[serde(serialize_with = "wrapper_newer")]
|
||||
|
|
|
@ -165,13 +165,6 @@ impl FeeRateGovernor {
|
|||
me
|
||||
}
|
||||
|
||||
pub fn clone_with_lamports_per_signature(&self, lamports_per_signature: u64) -> Self {
|
||||
Self {
|
||||
lamports_per_signature,
|
||||
..*self
|
||||
}
|
||||
}
|
||||
|
||||
/// calculate unburned fee from a fee total, returns (unburned, burned)
|
||||
pub fn burn(&self, fees: u64) -> (u64, u64) {
|
||||
let burned = fees * u64::from(self.burn_percent) / 100;
|
||||
|
|
Loading…
Reference in New Issue