Define ss58 prefix inside the runtime (#7810)

* Add SS58Prefix type to the frame_system config trait

* Remove unused chain_id runtime interface
This commit is contained in:
Alexander Theißen
2020-12-30 23:07:37 +01:00
committed by GitHub
parent bd48ff310d
commit ec2c70396e
67 changed files with 85 additions and 25 deletions
+8 -7
View File
@@ -81,6 +81,7 @@ impl frame_system::Config for Test {
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ();
}
parameter_types! {
pub const ExistentialDeposit: u64 = 1;
@@ -292,28 +293,28 @@ fn slash_tip_works() {
System::set_block_number(1);
Balances::make_free_balance_be(&Treasury::account_id(), 101);
assert_eq!(Treasury::pot(), 100);
assert_eq!(Balances::reserved_balance(0), 0);
assert_eq!(Balances::free_balance(0), 100);
assert_ok!(TipsModTestInst::report_awesome(Origin::signed(0), b"awesome.dot".to_vec(), 3));
assert_eq!(Balances::reserved_balance(0), 12);
assert_eq!(Balances::free_balance(0), 88);
let h = tip_hash();
assert_eq!(last_event(), RawEvent::NewTip(h));
// can't remove from any origin
assert_noop!(
TipsModTestInst::slash_tip(Origin::signed(0), h.clone()),
BadOrigin,
);
// can remove from root.
assert_ok!(TipsModTestInst::slash_tip(Origin::root(), h.clone()));
assert_eq!(last_event(), RawEvent::TipSlashed(h, 0, 12));
// tipper slashed
assert_eq!(Balances::reserved_balance(0), 0);
assert_eq!(Balances::free_balance(0), 88);