Claim funds on Substrate chain by providing proof of funds locking on PoA chain (#91)

* ethereum exchange module

* continue

* continue

* added tests for exchange module

* moved

* remove println

* move again

* fixes

* removed redundant deps

* cargo fmt

* fund_locks_transaction_decode_works

* cargo fmt --all

* fix error processing

* added some tracing to bridge modules

* more tests

* more tests

* cargo fmt --all

* kovan.rs -> exchange.rs

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* added assumption doc

* Airdrop -> DepositInto

* AsIs -> Identity

* OnTransactionSubmitted

* Transfers::Key = Id

* typo

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* block+tx+proof -> proof { block, tx, proof }

* cargo fmt --all

* docs

* check <-> verify

* parse hex

* extracted exchange primitives to separate crate

* added docs to runtime::exchange module

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* typo

* Update modules/currency-exchange/Cargo.toml

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* add docs to currency-exchange module

* change tests names

* cargo fmt --all

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Update bin/node/runtime/src/exchange.rs

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* fixed verify_transaction_finalized for siblings of finalized blocks

* cargo fmt --all

* added double spend note

* cargo fmt --all

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2020-06-05 04:12:31 +03:00
committed by Bastian Köcher
parent a7e7c895f6
commit 7294ea44e1
14 changed files with 1300 additions and 26 deletions
+2 -3
View File
@@ -103,7 +103,7 @@ fn prepare_votes<S: Storage>(
// we only take ancestors that are not yet pruned and those signed by
// the same set of validators
let mut parent_empty_step_signers = empty_steps_signers(header);
let ancestry = ancestry(storage, header)
let ancestry = ancestry(storage, header.parent_hash)
.map(|(hash, header, submitter)| {
let mut signers = BTreeSet::new();
sp_std::mem::swap(&mut signers, &mut parent_empty_step_signers);
@@ -196,9 +196,8 @@ fn empty_step_signer(empty_step: &SealedEmptyStep, parent_hash: &H256) -> Option
/// Return iterator of given header ancestors.
pub(crate) fn ancestry<'a, S: Storage>(
storage: &'a S,
header: &Header,
mut parent_hash: H256,
) -> impl Iterator<Item = (H256, Header, Option<S::Submitter>)> + 'a {
let mut parent_hash = header.parent_hash.clone();
from_fn(move || {
let (header, submitter) = storage.header(&parent_hash)?;
if header.number == 0 {