Skip to content

Commit

Permalink
Crowdloan rewards precompiles (polkadot-evm#607)
Browse files Browse the repository at this point in the history
* First sketch of claim

* Fmt and leftovers

* Catching up on tests

* First tests working

* Crowdloan precompiles start working

* New reward info precompile

* std in vec

* workspace fixing and lint

* More fmt

* Add to all runtimes

* Only moonbase tests working

* Forgot ignore in moonriver

* Undoing the ignore for moonriver

* add tracing subscriber to display logs

* precompile add to test

* Revert "add tracing subscriber to display logs"

This reverts commit 9a3ce4613d736987b448669483068af4621355aa.

* Check for target gas when reading storage

* Add common package for precompile utils

* Update toml file

* Add update_reward_address precompile

* Add update_reward_address with ignore to rest of the runtimes

* fmt

* fmt plus other review comments

* Better solidity writing

* Input bounds

* Remove trace log from common function

* Clean parachain-staking-precompile traces

* Revert introduced error

* utils

* Revert "Clean parachain-staking-precompile traces"

This reverts commit b8867379952baf64a9d25aa1d9ee5641b495f9fc.

* Clean parachain-staking

* Remove leftovers from previous utils

* fmt

Co-authored-by: nanocryk <6422796+nanocryk@users.noreply.github.com>
  • Loading branch information
girazoki and nanocryk committed Jul 22, 2021
1 parent 5016b4d commit e1e4c01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ std = [
"frame-system/std",
"pallet-evm/std",
"evm/std",
]
]
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ impl OutputBuilder {
self.data.extend_from_slice(&buffer);
self
}

/// Push a U256 to the output.
pub fn write_bool<T: Into<bool>>(mut self, value: T) -> Self {
let mut buffer = [0u8; 32];
if value.into() {
buffer[31] = 1;
}
self.data.extend_from_slice(&buffer);
self
}
}

impl Default for OutputBuilder {
Expand Down

0 comments on commit e1e4c01

Please sign in to comment.