Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator reward with runtime #1152

Merged
merged 7 commits into from
Aug 10, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions chain/chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ impl Chain {
vec![],
vec![],
0,
chain_genesis.gas_price,
chain_genesis.total_supply,
)?;
store_update.save_block_header(genesis.header.clone());
store_update.save_block(genesis.clone());
Expand Down Expand Up @@ -338,6 +340,8 @@ impl Chain {
vec![],
vec![],
header.gas_used,
header.gas_price,
header.total_supply,
)?;
}
}
Expand Down Expand Up @@ -1142,8 +1146,6 @@ impl<'a> ChainUpdate<'a> {
&block.hash(),
&receipts,
&chunk.transactions,
block.header.gas_price,
block.header.total_supply,
)
.map_err(|e| ErrorKind::Other(e.to_string()))?;

Expand Down Expand Up @@ -1310,6 +1312,8 @@ impl<'a> ChainUpdate<'a> {
vec![],
vec![],
block.header.gas_used,
block.header.gas_price,
block.header.total_supply,
)?;

// Add validated block to the db, even if it's not the selected fork.
Expand Down
4 changes: 2 additions & 2 deletions chain/chain/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ impl RuntimeAdapter for KeyValueRuntime {
_slashed_validators: Vec<AccountId>,
_validator_mask: Vec<bool>,
_gas_used: GasUsage,
_gas_price: Balance,
_total_supply: Balance,
) -> Result<(), Error> {
Ok(())
}
Expand All @@ -370,8 +372,6 @@ impl RuntimeAdapter for KeyValueRuntime {
_block_hash: &CryptoHash,
receipts: &Vec<ReceiptTransaction>,
transactions: &Vec<SignedTransaction>,
_gas_price: Balance,
_total_supply: Balance,
) -> Result<ApplyTransactionResult, Error> {
let mut tx_results = vec![];

Expand Down
4 changes: 2 additions & 2 deletions chain/chain/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ pub trait RuntimeAdapter: Send + Sync {
slashed_validators: Vec<AccountId>,
validator_mask: Vec<bool>,
gas_used: GasUsage,
gas_price: Balance,
total_supply: Balance,
) -> Result<(), Error>;

/// Apply transactions to given state root and return store update and new state root.
Expand All @@ -192,8 +194,6 @@ pub trait RuntimeAdapter: Send + Sync {
block_hash: &CryptoHash,
receipts: &Vec<ReceiptTransaction>,
transactions: &Vec<SignedTransaction>,
gas_price: Balance,
total_supply: Balance,
) -> Result<ApplyTransactionResult, Error>;

/// Query runtime with given `path` and `data`.
Expand Down
Loading