mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 05:37:58 +00:00
@@ -23,11 +23,11 @@ use frame_support::storage::{migration, unhashed};
|
||||
#[test]
|
||||
fn test_decode_compact_u32_at() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let v = codec::Compact(u64::max_value());
|
||||
let v = codec::Compact(u64::MAX);
|
||||
migration::put_storage_value(b"test", b"", &[], v);
|
||||
assert_eq!(decode_compact_u32_at(b"test"), None);
|
||||
|
||||
for v in vec![0, 10, u32::max_value()] {
|
||||
for v in vec![0, 10, u32::MAX] {
|
||||
let compact_v = codec::Compact(v);
|
||||
unhashed::put(b"test", &compact_v);
|
||||
assert_eq!(decode_compact_u32_at(b"test"), Some(v));
|
||||
|
||||
@@ -81,11 +81,11 @@ fn preimage_deposit_should_be_reapable_earlier_by_owner() {
|
||||
|
||||
next_block();
|
||||
assert_noop!(
|
||||
Democracy::reap_preimage(Origin::signed(6), set_balance_proposal_hash(2), u32::max_value()),
|
||||
Democracy::reap_preimage(Origin::signed(6), set_balance_proposal_hash(2), u32::MAX),
|
||||
Error::<Test>::TooEarly
|
||||
);
|
||||
next_block();
|
||||
assert_ok!(Democracy::reap_preimage(Origin::signed(6), set_balance_proposal_hash(2), u32::max_value()));
|
||||
assert_ok!(Democracy::reap_preimage(Origin::signed(6), set_balance_proposal_hash(2), u32::MAX));
|
||||
|
||||
assert_eq!(Balances::free_balance(6), 60);
|
||||
assert_eq!(Balances::reserved_balance(6), 0);
|
||||
@@ -96,7 +96,7 @@ fn preimage_deposit_should_be_reapable_earlier_by_owner() {
|
||||
fn preimage_deposit_should_be_reapable() {
|
||||
new_test_ext_execute_with_cond(|operational| {
|
||||
assert_noop!(
|
||||
Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::max_value()),
|
||||
Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::MAX),
|
||||
Error::<Test>::PreimageMissing
|
||||
);
|
||||
|
||||
@@ -111,12 +111,12 @@ fn preimage_deposit_should_be_reapable() {
|
||||
next_block();
|
||||
next_block();
|
||||
assert_noop!(
|
||||
Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::max_value()),
|
||||
Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::MAX),
|
||||
Error::<Test>::TooEarly
|
||||
);
|
||||
|
||||
next_block();
|
||||
assert_ok!(Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::max_value()));
|
||||
assert_ok!(Democracy::reap_preimage(Origin::signed(5), set_balance_proposal_hash(2), u32::MAX));
|
||||
assert_eq!(Balances::reserved_balance(6), 0);
|
||||
assert_eq!(Balances::free_balance(6), 48);
|
||||
assert_eq!(Balances::free_balance(5), 62);
|
||||
@@ -161,7 +161,7 @@ fn reaping_imminent_preimage_should_fail() {
|
||||
assert_ok!(Democracy::vote(Origin::signed(1), r, aye(1)));
|
||||
next_block();
|
||||
next_block();
|
||||
assert_noop!(Democracy::reap_preimage(Origin::signed(6), h, u32::max_value()), Error::<Test>::Imminent);
|
||||
assert_noop!(Democracy::reap_preimage(Origin::signed(6), h, u32::MAX), Error::<Test>::Imminent);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@ fn backing_for_should_work() {
|
||||
fn deposit_for_proposals_should_be_taken() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(propose_set_balance_and_note(1, 2, 5));
|
||||
assert_ok!(Democracy::second(Origin::signed(2), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(2), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
assert_eq!(Balances::free_balance(1), 5);
|
||||
assert_eq!(Balances::free_balance(2), 15);
|
||||
assert_eq!(Balances::free_balance(5), 35);
|
||||
@@ -49,10 +49,10 @@ fn deposit_for_proposals_should_be_taken() {
|
||||
fn deposit_for_proposals_should_be_returned() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(propose_set_balance_and_note(1, 2, 5));
|
||||
assert_ok!(Democracy::second(Origin::signed(2), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::max_value()));
|
||||
assert_ok!(Democracy::second(Origin::signed(2), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
assert_ok!(Democracy::second(Origin::signed(5), 0, u32::MAX));
|
||||
fast_forward_to(3);
|
||||
assert_eq!(Balances::free_balance(1), 10);
|
||||
assert_eq!(Balances::free_balance(2), 20);
|
||||
@@ -79,7 +79,7 @@ fn poor_seconder_should_not_work() {
|
||||
new_test_ext().execute_with(|| {
|
||||
assert_ok!(propose_set_balance_and_note(2, 2, 11));
|
||||
assert_noop!(
|
||||
Democracy::second(Origin::signed(1), 0, u32::max_value()),
|
||||
Democracy::second(Origin::signed(1), 0, u32::MAX),
|
||||
BalancesError::<Test, _>::InsufficientBalance
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user