Skip to content

Commit

Permalink
Ratio of validator_reward as mpn exec rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed May 17, 2023
1 parent 3bf0c34 commit 218ed53
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/node/heartbeat/generate_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ pub async fn generate_block<K: KvStore, B: Blockchain<K>>(
.blockchain
.min_validator_reward(ctx.validator_wallet.get_address())?;

// TODO: Remove Hardcoded rewards
let deposit_reward = Amount(u64::from(validator_reward) / 10 * 1);
let withdraw_reward = Amount(u64::from(validator_reward) / 10 * 1);
let update_reward = Amount(u64::from(validator_reward) / 10 * 3);

let deposit_nonce = ctx.blockchain.get_deposit_nonce(
ctx.validator_wallet.get_address(),
ctx.blockchain.config().mpn_config.mpn_contract_id,
Expand All @@ -55,9 +60,9 @@ pub async fn generate_block<K: KvStore, B: Blockchain<K>>(
withdraws,
updates,
validator_reward,
Amount(100_000_000_000), // TODO: Remove Hardcoded rewards
Amount(100_000_000_000),
Amount(300_000_000_000),
deposit_reward,
withdraw_reward,
update_reward,
deposit_nonce,
ctx.validator_wallet.clone(),
ctx.user_wallet.clone(),
Expand Down

0 comments on commit 218ed53

Please sign in to comment.