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

Enumeratable accounts #195

Merged
merged 85 commits into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
b20b807
Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic
gavofyork May 29, 2018
b7ca4ae
Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic
gavofyork May 29, 2018
b2a48c8
Update wasm.
gavofyork May 29, 2018
2d3a1ce
consensus, session and staking all panic-safe.
gavofyork May 29, 2018
881f6af
Democracy doesn't panic in apply.
gavofyork May 29, 2018
fee0f6f
Fix tests.
gavofyork May 29, 2018
8b9f50f
Extra helper macro, council depanicked.
gavofyork May 30, 2018
0e31a73
Fix one test.
gavofyork May 30, 2018
820ec13
Fix up all council tests. No panics!
gavofyork May 30, 2018
62ab840
Council voting depanicked.
gavofyork May 30, 2018
ff5da1a
Dispatch returns result.
gavofyork May 31, 2018
1123ff7
session & staking tests updated
gavofyork May 31, 2018
00ba4e0
Fix democracy tests.
gavofyork May 31, 2018
b6e54c1
Fix council tests.
gavofyork May 31, 2018
f3c1b9b
Fix up polkadot parachains in runtime
gavofyork May 31, 2018
3b8a4be
Merge branch 'master' into gav-result-dispatch
gavofyork May 31, 2018
d51a9bd
Merge remote-tracking branch 'origin/master' into gav-result-dispatch
gavofyork May 31, 2018
6c81a1e
Fix borked merge
gavofyork May 31, 2018
0141a68
More Slicable support
gavofyork Jun 1, 2018
34d0b75
Basic storage types.
gavofyork Jun 1, 2018
96a9b01
Existential deposit for contract creation
gavofyork Jun 1, 2018
ea2499f
Basic implemnetation along with removals
gavofyork Jun 1, 2018
193dde7
Fix tests.
gavofyork Jun 1, 2018
6f9636c
externalities builder fix.
gavofyork Jun 1, 2018
777f4dc
Tests.
gavofyork Jun 1, 2018
4027bd2
Fix up the runtime.
gavofyork Jun 1, 2018
de952ba
Fix tests.
gavofyork Jun 2, 2018
5e19a40
Add generic `Address` type.
gavofyork Jun 2, 2018
752f1a9
Merge branch 'master' into gav-enum-accounts
gavofyork Jun 2, 2018
014c13e
Initial function integration of Address into Extrinsic.
gavofyork Jun 3, 2018
8d34279
Fix build
gavofyork Jun 3, 2018
dd824ef
All tests compile.
gavofyork Jun 3, 2018
f2bebd2
Fix (some) tests.
gavofyork Jun 3, 2018
9ed26a5
Fix signing.
gavofyork Jun 3, 2018
f4ab2e5
Merge branch 'gav-enum-accounts' of github.com:paritytech/polkadot in…
gavofyork Jun 3, 2018
3a1835a
Push error.
gavofyork Jun 3, 2018
b3a5037
transfer can accept Address
gavofyork Jun 3, 2018
a0f0e05
Make Address generic over AccountIndex
gavofyork Jun 4, 2018
3e978c3
Fix test
gavofyork Jun 4, 2018
b04ff33
Make Council use Address for dispatch.
gavofyork Jun 4, 2018
95063be
Fix build
gavofyork Jun 4, 2018
0bd2d97
Bend over backwards to support braindead derive.
gavofyork Jun 4, 2018
e241ebd
Repot some files.
gavofyork Jun 4, 2018
67d1e74
Fix tests.
gavofyork Jun 4, 2018
d6439e8
Fix grumbles
gavofyork Jun 4, 2018
2a391c1
Remove Default bound
gavofyork Jun 4, 2018
2353b0b
Fix build for new nightly.
gavofyork Jun 4, 2018
1f5b7da
Merge remote-tracking branch 'origin/master' into gav-enum-accounts
gavofyork Jun 4, 2018
904c7cc
Make `apply_extrinsic` never panic, return useful Result.
gavofyork Jun 4, 2018
cef4d4e
Merge remote-tracking branch 'origin/master' into gav-enum-accounts
gavofyork Jun 5, 2018
5401577
Merge remote-tracking branch 'origin/master' into gav-enum-accounts
gavofyork Jun 7, 2018
48d1e9f
More merge hell
gavofyork Jun 7, 2018
b689e16
Doesn't build, but might do soon
gavofyork Jun 7, 2018
f9f875e
Serde woes
gavofyork Jun 7, 2018
d83316a
get substrate-runtime-staking compiling
rphmeier Jun 7, 2018
86de50a
Polkadot builds again!
gavofyork Jun 8, 2018
fcdfdce
Fix all build.
gavofyork Jun 8, 2018
9ad1272
Fix tests & binaries.
gavofyork Jun 8, 2018
6d27096
Merge remote-tracking branch 'origin/master' into gav-enum-accounts
gavofyork Jun 8, 2018
d3cb378
Reserve some extra initial byte values of address for future format c…
gavofyork Jun 8, 2018
c614f5d
Make semantic of `ReservedBalance` clear.
gavofyork Jun 8, 2018
684daf0
Fix panic handler.
gavofyork Jun 8, 2018
f5a8b74
Integrate other balance transformations into the new model
gavofyork Jun 8, 2018
6ba768d
Fix runtime tests.
gavofyork Jun 9, 2018
3534cc5
Fix panic build.
gavofyork Jun 10, 2018
267c360
Tests for demonstrating interaction between balance types.
gavofyork Jun 10, 2018
7abaa1d
Repot some runtime code
gavofyork Jun 10, 2018
2a39363
Fix checkedblock in non-std builds
gavofyork Jun 10, 2018
8b820ed
Get rid of `DoLookup` phantom.
gavofyork Jun 11, 2018
a6426db
Attempt to make transaction_pool work with lookups.
gavofyork Jun 11, 2018
fe6fee9
Remove vscode settings
gavofyork Jun 11, 2018
766e455
New attempt at making transaction pool work.
gavofyork Jun 12, 2018
2015e6d
It builds again!
gavofyork Jun 12, 2018
584d3e1
--all builds
gavofyork Jun 12, 2018
25bd52e
Fix tests.
gavofyork Jun 12, 2018
917455e
New build.
gavofyork Jun 12, 2018
abe5d64
Test account nonce reset.
gavofyork Jun 12, 2018
c4b2703
polkadot transaction pool tests/framework.
gavofyork Jun 13, 2018
8269eb3
Address grumbles.
gavofyork Jun 14, 2018
1cea609
Revert bad `map_or`
gavofyork Jun 14, 2018
49b539e
Merge remote-tracking branch 'origin/dk-pwasm-alloc-fix' into gav-enu…
gavofyork Jun 15, 2018
8e30aad
Rebuild binaries, workaround.
gavofyork Jun 15, 2018
0e2aa61
Merge
gavofyork Jun 15, 2018
8065ad8
Avoid casting to usize early.
gavofyork Jun 15, 2018
1f561c2
reenable sync tests
gavofyork Jun 18, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions demo/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
intentions: vec![],
transaction_base_fee: 100,
transaction_byte_fee: 1,
transfer_fee: 0,
creation_fee: 0,
contract_fee: 0,
reclaim_rebate: 0,
existential_deposit: 500,
balances: vec![(god_key.clone().into(), 1u64 << 63)].into_iter().collect(),
validator_count: 12,
sessions_per_era: 24, // 24 hours per era.
Expand Down
132 changes: 84 additions & 48 deletions demo/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ mod tests {
use runtime_support::{Hashable, StorageValue, StorageMap};
use state_machine::{CodeExecutor, TestExternalities};
use primitives::twox_128;
use demo_primitives::{Hash, BlockNumber};
use demo_primitives::{Hash, BlockNumber, AccountId};
use runtime_primitives::traits::Header as HeaderT;
use runtime_primitives::{ApplyOutcome, ApplyError, ApplyResult, MaybeUnsigned};
use {staking, system};
use demo_runtime::{Header, Block, UncheckedExtrinsic, Extrinsic, Call, Concrete, Staking,
BuildExternalities, GenesisConfig, SessionConfig, StakingConfig};
BuildExternalities, GenesisConfig, SessionConfig, StakingConfig, BareExtrinsic};
use ed25519::{Public, Pair};

const BLOATY_CODE: &[u8] = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm");
Expand All @@ -63,24 +64,28 @@ mod tests {
)
}

fn alice() -> Hash {
Keyring::Alice.to_raw_public().into()
fn alice() -> AccountId {
AccountId::from(Keyring::Alice.to_raw_public())
}

fn bob() -> Hash {
Keyring::Bob.to_raw_public().into()
fn bob() -> AccountId {
AccountId::from(Keyring::Bob.to_raw_public())
}

fn xt() -> UncheckedExtrinsic {
let extrinsic = Extrinsic {
let extrinsic = BareExtrinsic {
signed: alice(),
index: 0,
function: Call::Staking(staking::Call::transfer::<Concrete>(bob(), 69)),
function: Call::Staking(staking::Call::transfer::<Concrete>(bob().into(), 69)),
};
let signature = Keyring::from_raw_public(extrinsic.signed.0).unwrap()
.sign(&extrinsic.encode()).into();

UncheckedExtrinsic { extrinsic, signature }
let signature = MaybeUnsigned(Keyring::from_raw_public(extrinsic.signed.0.clone()).unwrap()
.sign(&extrinsic.encode()).into());
let extrinsic = Extrinsic {
signed: extrinsic.signed.into(),
index: extrinsic.index,
function: extrinsic.function,
};
UncheckedExtrinsic::new(extrinsic, signature)
}

fn from_block_number(n: u64) -> Header {
Expand All @@ -93,28 +98,36 @@ mod tests {
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![69u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![70u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

let r = Executor::new().call(&mut t, BLOATY_CODE, "initialise_block", &vec![].and(&from_block_number(1u64)));
assert!(r.is_ok());
let r = Executor::new().call(&mut t, BLOATY_CODE, "apply_extrinsic", &vec![].and(&xt()));
assert!(r.is_err());
let v = Executor::new().call(&mut t, BLOATY_CODE, "apply_extrinsic", &vec![].and(&xt())).unwrap();
let r = ApplyResult::decode(&mut &v[..]).unwrap();
assert_eq!(r, Err(ApplyError::CantPay));
}

#[test]
fn panic_execution_with_native_equivalent_code_gives_error() {
fn bad_extrinsic_with_native_equivalent_code_gives_error() {
let mut t: TestExternalities = map![
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![69u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![70u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

let r = Executor::new().call(&mut t, COMPACT_CODE, "initialise_block", &vec![].and(&from_block_number(1u64)));
assert!(r.is_ok());
let r = Executor::new().call(&mut t, COMPACT_CODE, "apply_extrinsic", &vec![].and(&xt()));
assert!(r.is_err());
let v = Executor::new().call(&mut t, COMPACT_CODE, "apply_extrinsic", &vec![].and(&xt())).unwrap();
let r = ApplyResult::decode(&mut &v[..]).unwrap();
assert_eq!(r, Err(ApplyError::CantPay));
}

#[test]
Expand All @@ -123,6 +136,9 @@ mod tests {
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

Expand All @@ -132,8 +148,8 @@ mod tests {
assert!(r.is_ok());

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 42);
assert_eq!(Staking::balance(&bob()), 69);
assert_eq!(Staking::voting_balance(&alice()), 42);
assert_eq!(Staking::voting_balance(&bob()), 69);
});
}

Expand All @@ -143,6 +159,9 @@ mod tests {
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

Expand All @@ -152,8 +171,8 @@ mod tests {
assert!(r.is_ok());

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 42);
assert_eq!(Staking::balance(&bob()), 69);
assert_eq!(Staking::voting_balance(&alice()), 42);
assert_eq!(Staking::voting_balance(&bob()), 69);
});
}

Expand All @@ -176,20 +195,29 @@ mod tests {
bonding_duration: 0,
transaction_base_fee: 1,
transaction_byte_fee: 0,
existential_deposit: 0,
transfer_fee: 0,
creation_fee: 0,
contract_fee: 0,
reclaim_rebate: 0,
}),
democracy: Some(Default::default()),
council: Some(Default::default()),
}.build_externalities()
}

fn construct_block(number: BlockNumber, parent_hash: Hash, state_root: Hash, extrinsics: Vec<Extrinsic>) -> (Vec<u8>, Hash) {
fn construct_block(number: BlockNumber, parent_hash: Hash, state_root: Hash, extrinsics: Vec<BareExtrinsic>) -> (Vec<u8>, Hash) {
use triehash::ordered_trie_root;

let extrinsics = extrinsics.into_iter().map(|extrinsic| {
let signature = Pair::from(Keyring::from_public(Public::from_raw(extrinsic.signed.0)).unwrap())
.sign(&extrinsic.encode()).into();

UncheckedExtrinsic { extrinsic, signature }
let signature = MaybeUnsigned(Pair::from(Keyring::from_public(Public::from_raw(extrinsic.signed.0.clone())).unwrap())
.sign(&extrinsic.encode()).into());
let extrinsic = Extrinsic {
signed: extrinsic.signed.into(),
index: extrinsic.index,
function: extrinsic.function,
};
UncheckedExtrinsic::new(extrinsic, signature)
}).collect::<Vec<_>>();

let extrinsics_root = ordered_trie_root(extrinsics.iter().map(Slicable::encode)).0.into();
Expand All @@ -210,11 +238,11 @@ mod tests {
construct_block(
1,
[69u8; 32].into(),
hex!("76b0393b4958d3cb98bb51d9f4edb316af48485142b8721e94c3b52c75ec3243").into(),
vec![Extrinsic {
hex!("4f7a61bceecddc19d49fbee53f82402c2a8727c1b2aeb5e5070a59f0777a203b").into(),
vec![BareExtrinsic {
signed: alice(),
index: 0,
function: Call::Staking(staking::Call::transfer(bob(), 69)),
function: Call::Staking(staking::Call::transfer(bob().into(), 69)),
}]
)
}
Expand All @@ -223,17 +251,17 @@ mod tests {
construct_block(
2,
block1().1,
hex!("8ae9828a5988459d35fb428086170dead660176ee0766e89bc1a4b48153d4e88").into(),
hex!("67c588603dd727601263cf8d6138a2003ffc0df793c5ea34e7defc945da24bf0").into(),
vec![
Extrinsic {
BareExtrinsic {
signed: bob(),
index: 0,
function: Call::Staking(staking::Call::transfer(alice(), 5)),
function: Call::Staking(staking::Call::transfer(alice().into(), 5)),
},
Extrinsic {
BareExtrinsic {
signed: alice(),
index: 1,
function: Call::Staking(staking::Call::transfer(bob(), 15)),
function: Call::Staking(staking::Call::transfer(bob().into(), 15)),
}
]
)
Expand All @@ -246,15 +274,15 @@ mod tests {
Executor::new().call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap();

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 41);
assert_eq!(Staking::balance(&bob()), 69);
assert_eq!(Staking::voting_balance(&alice()), 41);
assert_eq!(Staking::voting_balance(&bob()), 69);
});

Executor::new().call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap();

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 30);
assert_eq!(Staking::balance(&bob()), 78);
assert_eq!(Staking::voting_balance(&alice()), 30);
assert_eq!(Staking::voting_balance(&bob()), 78);
});
}

Expand All @@ -265,15 +293,15 @@ mod tests {
WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block1().0).unwrap();

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 41);
assert_eq!(Staking::balance(&bob()), 69);
assert_eq!(Staking::voting_balance(&alice()), 41);
assert_eq!(Staking::voting_balance(&bob()), 69);
});

WasmExecutor.call(&mut t, COMPACT_CODE, "execute_block", &block2().0).unwrap();

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 30);
assert_eq!(Staking::balance(&bob()), 78);
assert_eq!(Staking::voting_balance(&alice()), 30);
assert_eq!(Staking::voting_balance(&bob()), 78);
});
}

Expand All @@ -283,14 +311,18 @@ mod tests {
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![69u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![70u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.wasm");
let r = WasmExecutor.call(&mut t, &foreign_code[..], "initialise_block", &vec![].and(&from_block_number(1u64)));
assert!(r.is_ok());
let r = WasmExecutor.call(&mut t, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt()));
assert!(r.is_err());
let r = WasmExecutor.call(&mut t, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt())).unwrap();
let r = ApplyResult::decode(&mut &r[..]).unwrap();
assert_eq!(r, Err(ApplyError::CantPay));
}

#[test]
Expand All @@ -299,18 +331,22 @@ mod tests {
twox_128(&<staking::FreeBalance<Concrete>>::key_for(alice())).to_vec() => vec![111u8, 0, 0, 0, 0, 0, 0, 0],
twox_128(<staking::TransactionBaseFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransactionByteFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::ExistentialDeposit<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::TransferFee<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(<staking::NextEnumSet<Concrete>>::key()).to_vec() => vec![0u8; 8],
twox_128(&<system::BlockHash<Concrete>>::key_for(0)).to_vec() => vec![0u8; 32]
];

let foreign_code = include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/demo_runtime.compact.wasm");
let r = WasmExecutor.call(&mut t, &foreign_code[..], "initialise_block", &vec![].and(&from_block_number(1u64)));
assert!(r.is_ok());
let r = WasmExecutor.call(&mut t, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt()));
assert!(r.is_ok());
let r = WasmExecutor.call(&mut t, &foreign_code[..], "apply_extrinsic", &vec![].and(&xt())).unwrap();
let r = ApplyResult::decode(&mut &r[..]).unwrap();
assert_eq!(r, Ok(ApplyOutcome::Success));

runtime_io::with_externalities(&mut t, || {
assert_eq!(Staking::balance(&alice()), 42);
assert_eq!(Staking::balance(&bob()), 69);
assert_eq!(Staking::voting_balance(&alice()), 42);
assert_eq!(Staking::voting_balance(&bob()), 69);
});
}
}
6 changes: 5 additions & 1 deletion demo/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ pub type BlockNumber = u64;
/// certainly continue to be the same as the substrate's `AuthorityId`.
pub type AccountId = ::primitives::H256;

/// The type for looking up accounts. We don't expect more than 4 billion of them, but you
/// never know...
pub type AccountIndex = u32;

/// Balance of an account.
pub type Balance = u64;

Expand All @@ -49,4 +53,4 @@ pub type Index = u64;
pub type Hash = primitives::H256;

/// Alias to 512-bit hash when used in the context of a signature on the relay chain.
pub type Signature = runtime_primitives::Ed25519Signature;
pub type Signature = runtime_primitives::MaybeUnsigned<runtime_primitives::Ed25519Signature>;
Copy link
Contributor

Choose a reason for hiding this comment

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

a little unfortunate that we have to fall back to maybe-unsigned here.

Loading