Skip to content

Conversation

cheezus1
Copy link
Contributor

closes #83


@spec add_fees_to_block_state(list(), map()) :: map()
def add_fees_to_block_state(txs, block_state) do
pubkey = elem(Keys.pubkey(), 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the pubkey accessed here?

end

@spec add_fees_to_block_state(list(), map()) :: map()
def add_fees_to_block_state(txs, block_state) do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this function do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it adds the sum of the fees to the given account in the block state

Copy link
Collaborator

@thepiwo thepiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test where the miner collects all the fees from the transactions included in the block?

Copy link
Collaborator

@thepiwo thepiwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix test

@cheezus1 cheezus1 requested a review from cytadela8 November 3, 2017 10:08
@thepiwo
Copy link
Collaborator

thepiwo commented Nov 3, 2017

I think the sum_coinbase_transactions is wrong, it should add only coinbase transactions values and compare with the Miner.coinbase_transaction_value() + sum of tx fees

@andonov andonov merged commit 56c8a5d into master Nov 3, 2017
@thepiwo thepiwo deleted the GH-83 branch October 5, 2018 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add fee to transaction

4 participants