fixfees on grin-wallet (#526)

* change fee to fee_fields in various structs and fix tests for new fee calculation

* set up accept_fee_base param in grin-wallet.toml

* fix bug and adopt new tx_fee interface

* Fix doctests

* Remove left over debug statement

* revert field name feef to fee to remain slate compatible

* use into() for some literal fee_fields

* add height arguments to FeeFields methods where necessary

* Fix tests

* Rename fee_fields -> fee on Context

* Rename fee_fields -> fee on TxLogEntry

* Update to grin master

* replace fee(0) by fee(2*YEAR_HEIGHT) to get fee masking

* Fix compilation error and revert Cargo lock

* fix wrong height passed into next_difficulty

Co-authored-by: Jasper van der Maarel <j@sper.dev>
This commit is contained in:
John Tromp
2020-11-26 20:46:03 +01:00
committed by GitHub
co-authored by Jasper van der Maarel
parent 429db61bb7
commit 8334304c16
21 changed files with 196 additions and 140 deletions
+3 -2
View File
@@ -107,7 +107,8 @@ fn create_block_with_reward(
reward_output: Output,
reward_kernel: TxKernel,
) -> core::core::Block {
let next_header_info = consensus::next_difficulty(1, chain.difficulty_iter().unwrap());
let next_header_info =
consensus::next_difficulty(prev.height + 1, chain.difficulty_iter().unwrap());
let mut b = core::core::Block::new(
&prev,
txs,
@@ -155,7 +156,7 @@ where
K: keychain::Keychain + 'a,
{
// build block fees
let fee_amt = txs.iter().map(|tx| tx.fee()).sum();
let fee_amt = txs.iter().map(|tx| tx.fee(prev.height + 1)).sum();
let block_fees = BlockFees {
fees: fee_amt,
key_id: None,