mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Lazy reaping (#4895)
* Squash and rebase from gav-lazy-reaping * Bump version * Bump runtime again * Docs. * Remove old functions * Update frame/balances/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/contracts/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Warnings * Bump runtime version * Update frame/democracy/src/lib.rs Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/system/src/lib.rs * Clean up OnReapAccount * Use frame_support debug * Bump spec * Renames and fix * Fix * Fix rename * Fix * Increase time for test Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Benjamin Kampmann <ben.kampmann@googlemail.com>
This commit is contained in:
@@ -164,7 +164,7 @@ fn panic_execution_with_foreign_code_gives_error() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(BLOATY_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(69u128, 0u128, 0u128, 0u128).encode()
|
||||
(69u128, 0u8, 0u128, 0u128, 0u128).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
69_u128.encode()
|
||||
@@ -200,7 +200,7 @@ fn bad_extrinsic_with_native_equivalent_code_gives_error() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(COMPACT_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(0u32, 69u128, 0u128, 0u128, 0u128).encode()
|
||||
(0u32, 0u8, 69u128, 0u128, 0u128, 0u128).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
69_u128.encode()
|
||||
@@ -236,7 +236,7 @@ fn successful_execution_with_native_equivalent_code_gives_ok() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(COMPACT_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(0u32, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
(0u32, 0u8, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
(111 * DOLLARS).encode()
|
||||
@@ -278,7 +278,7 @@ fn successful_execution_with_foreign_code_gives_ok() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(BLOATY_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(0u32, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
(0u32, 0u8, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
(111 * DOLLARS).encode()
|
||||
@@ -734,7 +734,7 @@ fn successful_execution_gives_ok() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(COMPACT_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(0u32, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
(0u32, 0u8, 111 * DOLLARS, 0u128, 0u128, 0u128).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
(111 * DOLLARS).encode()
|
||||
|
||||
@@ -139,10 +139,10 @@ fn transaction_fee_is_correct_ultimate() {
|
||||
let mut t = TestExternalities::<Blake2Hasher>::new_with_code(COMPACT_CODE, Storage {
|
||||
top: map![
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(alice()) => {
|
||||
(0u32, 100 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS).encode()
|
||||
(0u32, 0u8, 100 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS).encode()
|
||||
},
|
||||
<frame_system::Account<Runtime>>::hashed_key_for(bob()) => {
|
||||
(0u32, 10 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS).encode()
|
||||
(0u32, 0u8, 10 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS, 0 * DOLLARS).encode()
|
||||
},
|
||||
<pallet_balances::TotalIssuance<Runtime>>::hashed_key().to_vec() => {
|
||||
(110 * DOLLARS).encode()
|
||||
|
||||
@@ -167,8 +167,9 @@ fn submitted_transaction_should_be_valid() {
|
||||
// add balance to the account
|
||||
let author = extrinsic.signature.clone().unwrap().0;
|
||||
let address = Indices::lookup(author).unwrap();
|
||||
let account = pallet_balances::AccountData { free: 5_000_000_000_000, ..Default::default() };
|
||||
<frame_system::Account<Runtime>>::insert(&address, (0u32, account));
|
||||
let data = pallet_balances::AccountData { free: 5_000_000_000_000, ..Default::default() };
|
||||
let account = frame_system::AccountInfo { nonce: 0u32, refcount: 0u8, data };
|
||||
<frame_system::Account<Runtime>>::insert(&address, account);
|
||||
|
||||
// check validity
|
||||
let res = Executive::validate_transaction(extrinsic);
|
||||
|
||||
Reference in New Issue
Block a user