Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

simplify BlockReward::reward implementation #10906

Merged
merged 3 commits into from
Jul 30, 2019
Merged

Conversation

debris
Copy link
Collaborator

@debris debris commented Jul 21, 2019

reduce number of expects

@debris debris added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jul 21, 2019
@debris debris requested review from ordian and niklasad1 July 21, 2019 13:44
@ordian ordian added this to the 2.7 milestone Jul 21, 2019
@ordian ordian added A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 21, 2019
Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Tests need to be fixed:

error[E0308]: mismatched types
   --> ethcore/src/engines/block_reward.rs:207:40
    |
207 |         assert!(block_reward_contract.reward(&vec![], &mut call).unwrap().is_empty());
    |                                              ^^^^^^^
    |                                              |
    |                                              expected struct `std::vec::Vec`, found reference
    |                                              help: consider removing the borrow: `vec![]`
    |
    = note: expected type `std::vec::Vec<(ethereum_types::H160, engines::block_reward::RewardKind)>`
               found type `&std::vec::Vec<_>`

error[E0308]: mismatched types
   --> ethcore/src/engines/block_reward.rs:216:46
    |
216 |         let rewards = block_reward_contract.reward(&beneficiaries, &mut call).unwrap();
    |                                                    ^^^^^^^^^^^^^^
    |                                                    |
    |                                                    expected struct `std::vec::Vec`, found reference
    |                                                    help: consider removing the borrow: `beneficiaries`
    |
    = note: expected type `std::vec::Vec<(ethereum_types::H160, engines::block_reward::RewardKind)>`
               found type `&std::vec::Vec<(ethereum_types::H160, engines::block_reward::RewardKind)>`

error: aborting due to 2 previous errors

Copy link
Collaborator

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM, but the tests need to be fixed as Andronik already said

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. labels Jul 30, 2019
@debris debris merged commit 12256a1 into master Jul 30, 2019
@debris debris deleted the simplify-block-reward branch July 30, 2019 10:05
ordian added a commit that referenced this pull request Aug 7, 2019
* master:
  journaldb changes (#10929)
  Allow default block parameter to be blockHash (#10932)
  Enable sealing when engine is ready (#10938)
  Fix some warnings and typos. (#10941)
  Updated security@parity.io key (#10939)
  Change the return type of step_inner function. (#10940)
  get rid of hidden mutability of Spec (#10904)
  simplify BlockReward::reward implementation (#10906)
  Kaspersky AV whitelisting (#10919)
  additional arithmetic EVM opcode benchmarks (#10916)
  [Cargo.lock] cargo update -p crossbeam-epoch (#10921)
  Fixes incorrect comment. (#10913)
  Add file path to disk map write/read warnings (#10911)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants