-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into v2.0-testnet
- Loading branch information
Showing
21 changed files
with
781 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use cfx_types::U256; | ||
use std::collections::VecDeque; | ||
|
||
#[derive(Serialize, Debug, Default)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct CfxFeeHistory { | ||
/// Oldest epoch | ||
oldest_epoch: U256, | ||
/// An array of pivot block base fees per gas. This includes one block | ||
/// earlier than the oldest block. Zeroes are returned for pre-EIP-1559 | ||
/// blocks. | ||
base_fee_per_gas: VecDeque<U256>, | ||
/// In Conflux, 1559 is adjusted by the current block's gas limit of total | ||
/// transactions, instead of parent's gas used | ||
gas_used_ratio: VecDeque<f64>, | ||
/// A two-dimensional array of effective priority fees per gas at the | ||
/// requested block percentiles. | ||
reward: VecDeque<Vec<U256>>, | ||
} | ||
|
||
impl CfxFeeHistory { | ||
pub fn new( | ||
oldest_epoch: U256, base_fee_per_gas: VecDeque<U256>, | ||
gas_used_ratio: VecDeque<f64>, reward: VecDeque<Vec<U256>>, | ||
) -> Self { | ||
CfxFeeHistory { | ||
oldest_epoch, | ||
base_fee_per_gas, | ||
gas_used_ratio, | ||
reward, | ||
} | ||
} | ||
|
||
pub fn reward(&self) -> &VecDeque<Vec<U256>> { &self.reward } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
mod access_list; | ||
pub mod address; | ||
pub mod call_request; | ||
mod fee_history; | ||
|
||
pub use access_list::*; | ||
pub use address::RpcAddress; | ||
pub use fee_history::*; |
Oops, something went wrong.