From 4fcc77fd54f86572ee610036cc9057b9d2cf304a Mon Sep 17 00:00:00 2001 From: Guy Garcia Date: Thu, 31 Oct 2024 10:33:26 -0400 Subject: [PATCH 1/2] Added block gas limit --- packages/archway-test-tube/libarchway/testenv/setup.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/archway-test-tube/libarchway/testenv/setup.go b/packages/archway-test-tube/libarchway/testenv/setup.go index dbb84a4..ed14702 100644 --- a/packages/archway-test-tube/libarchway/testenv/setup.go +++ b/packages/archway-test-tube/libarchway/testenv/setup.go @@ -202,10 +202,9 @@ func InitChain(appInstance *app.ArchwayApp) (sdk.Context, secp256k1.PrivKey) { requireNoErr(err) concensusParams := simtestutil.DefaultConsensusParams - // TODO: max gas could be set to 300mil concensusParams.Block = &cmtproto.BlockParams{ MaxBytes: 22020096, - MaxGas: -1, + MaxGas: 300000000, } // replace sdk.DefaultDenom with "aarch", a bit of a hack, needs improvement From 5927fce5f9e127338b56cd5786e29852971f9688 Mon Sep 17 00:00:00 2001 From: Guy Garcia Date: Thu, 31 Oct 2024 10:33:59 -0400 Subject: [PATCH 2/2] Removed test that wasn't working nor making sense anymore --- packages/archway-test-tube/src/lib.rs | 41 --------------------------- 1 file changed, 41 deletions(-) diff --git a/packages/archway-test-tube/src/lib.rs b/packages/archway-test-tube/src/lib.rs index 211e5e9..85ca931 100644 --- a/packages/archway-test-tube/src/lib.rs +++ b/packages/archway-test-tube/src/lib.rs @@ -674,47 +674,6 @@ mod tests { assert!(admin_list.mutable); } - #[test] - fn test_custom_fee() { - let app = ArchwayApp::default(); - let initial_balance = 1_000_000_000_000_000_000_000; - let alice = app.init_account(&coins(initial_balance, "aarch")).unwrap(); - let bob = app.init_account(&coins(initial_balance, "aarch")).unwrap(); - - let amount = Coin::new(1_000_000u128, "aarch"); - let gas_limit = 100_000_000; - - // use FeeSetting::Auto by default, so should not equal newly custom fee setting - let wasm = Wasm::new(&app); - let wasm_byte_code = std::fs::read("./test_artifacts/cw1_whitelist.wasm").unwrap(); - let res = wasm.store_code(&wasm_byte_code, None, &alice).unwrap(); - - assert_ne!(res.gas_info.gas_wanted, gas_limit); - - //update fee setting - let bob = bob.with_fee_setting(FeeSetting::Custom { - amount: amount.clone(), - gas_limit, - }); - let _res = wasm.store_code(&wasm_byte_code, None, &bob).unwrap(); - - let bob_balance = Bank::new(&app) - .query_all_balances(&QueryAllBalancesRequest { - address: bob.address(), - pagination: None, - }) - .unwrap() - .balances - .into_iter() - .find(|c| c.denom == "aarch") - .unwrap() - .amount - .parse::() - .unwrap(); - - assert_eq!(bob_balance, initial_balance - amount.amount.u128()); - } - #[test] fn test_block_skipping() { let app = ArchwayApp::default();