diff --git a/packages/osmosis-test-tube/Cargo.toml b/packages/osmosis-test-tube/Cargo.toml index aadda298..c6810b4c 100644 --- a/packages/osmosis-test-tube/Cargo.toml +++ b/packages/osmosis-test-tube/Cargo.toml @@ -4,20 +4,22 @@ edition = "2021" license = "MIT OR Apache-2.0" name = "osmosis-test-tube" repository = "https://github.com/osmosis-labs/test-tube" -version = "24.0.1" +version = "25.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html exclude = ["osmosis", "test_artifacts"] [dependencies] base64 = "0.21.5" -cosmrs = {version = "0.15.0", features = ["cosmwasm"]} -cosmwasm-std = "1.4.0" -osmosis-std = {git = " https://github.com/osmosis-labs/osmosis-rust", branch = "main"} +cosmrs = { version = "0.15.0", features = ["cosmwasm"] } +cosmwasm-std = "1.5.5" +osmosis-std = "0.25.0" prost = "0.12.3" serde = "1.0.144" serde_json = "1.0.85" -test-tube = {version = "0.6.0", path = "../test-tube", features = ["module-wrappers"]} +test-tube = { version = "0.7.0", path = "../test-tube", features = [ + "module-wrappers", +] } thiserror = "1.0.34" [features] @@ -30,4 +32,4 @@ bindgen = "0.69.1" [dev-dependencies] cw1-whitelist = "1.1.1" rayon = "1.5.3" -simple-sudo = {path = "../../test_contracts/simple-sudo"} +simple-sudo = { path = "../../test_contracts/simple-sudo" } diff --git a/packages/osmosis-test-tube/README.md b/packages/osmosis-test-tube/README.md index 8f3e957b..611cbdb0 100644 --- a/packages/osmosis-test-tube/README.md +++ b/packages/osmosis-test-tube/README.md @@ -29,8 +29,8 @@ let app = OsmosisTestApp::new(); let accs = app .init_accounts( &[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ], 2, ) @@ -53,8 +53,8 @@ use osmosis_test_tube::OsmosisTestApp; let app = OsmosisTestApp::new(); let account = app.init_account(&[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ]); ``` @@ -75,8 +75,8 @@ let app = OsmosisTestApp::new(); let accs = app .init_accounts( &[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ], 2, ) @@ -111,8 +111,8 @@ let app = OsmosisTestApp::new(); let accs = app .init_accounts( &[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ], 2, ) @@ -170,8 +170,8 @@ let app = OsmosisTestApp::new(); let accs = app .init_accounts( &[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ], 2, ) @@ -254,8 +254,8 @@ use osmosis_test_tube::{Account, Module, OsmosisTestApp, Gamm}; let app = OsmosisTestApp::default(); let alice = app .init_account(&[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ]) .unwrap(); @@ -263,7 +263,7 @@ let alice = app let gamm = Gamm::new(&app); // create balancer pool with basic configuration -let pool_liquidity = vec![Coin::new(1_000, "uatom"), Coin::new(1_000, "uosmo")]; +let pool_liquidity = vec![Coin::new(1_000u128, "uatom"), Coin::new(1_000u128, "uosmo")]; let pool_id = gamm .create_basic_pool(&pool_liquidity, &alice) .unwrap() diff --git a/packages/osmosis-test-tube/libosmosistesttube/go.mod b/packages/osmosis-test-tube/libosmosistesttube/go.mod index 0b8036e0..c64a7e39 100644 --- a/packages/osmosis-test-tube/libosmosistesttube/go.mod +++ b/packages/osmosis-test-tube/libosmosistesttube/go.mod @@ -2,7 +2,7 @@ module github.com/osmosis-labs/test-tube/osmosis-test-tube go 1.21.4 -toolchain go1.21.6 +toolchain go1.22.3 require ( cosmossdk.io/errors v1.0.1 @@ -12,7 +12,7 @@ require ( github.com/cometbft/cometbft-db v0.11.0 github.com/cosmos/cosmos-sdk v0.47.8 github.com/cosmos/gogoproto v1.4.11 - github.com/osmosis-labs/osmosis/v25 v25.0.0-20240430100100-f8586428a1d5 + github.com/osmosis-labs/osmosis/v25 v25.0.0 github.com/pkg/errors v0.9.1 ) @@ -136,11 +136,11 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/osmosis-labs/osmosis/osmomath v0.0.12-0.20240423073233-246239a8f662 // indirect - github.com/osmosis-labs/osmosis/osmoutils v0.0.12-0.20240430090100-86b41c48fe1b // indirect - github.com/osmosis-labs/osmosis/x/epochs v0.0.8-0.20240423073233-246239a8f662 // indirect - github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.14-0.20240423073233-246239a8f662 // indirect - github.com/osmosis-labs/sqs/sqsdomain v0.0.0-20240429202838-7d69de2c9bea // indirect + github.com/osmosis-labs/osmosis/osmomath v0.0.13 // indirect + github.com/osmosis-labs/osmosis/osmoutils v0.0.13 // indirect + github.com/osmosis-labs/osmosis/x/epochs v0.0.9 // indirect + github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.15 // indirect + github.com/osmosis-labs/sqs/sqsdomain v0.18.1 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230518223814-80aa455d8761 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -213,33 +213,28 @@ exclude github.com/cometbft/cometbft v0.38.0 // ## local replace // replace github.com/osmosis-labs/osmosis/v23 => ../../../../osmosis -replace ( - // adds expedited proposal support and 1000MB cache default - // https://github.com/osmosis-labs/wasmd/releases/tag/v0.45.0-osmo - github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.45.0-osmo +replace github.com/CosmWasm/wasmd => github.com/osmosis-labs/wasmd v0.45.0-osmo - // Using branch osmo-v24/v0.37.4 - // https://github.com/osmosis-labs/cometbft/releases/tag/v0.37.4-v24-osmo-3 - github.com/cometbft/cometbft => github.com/osmosis-labs/cometbft v0.37.4-v24-osmo-3 +replace github.com/cometbft/cometbft => github.com/osmosis-labs/cometbft v0.37.4-v25-osmo-2 - // v1.0.0-beta.3 is incompatible, so we use v1.0.0-beta.2 - github.com/cosmos/cosmos-proto => github.com/cosmos/cosmos-proto v1.0.0-beta.2 +replace github.com/cosmos/cosmos-proto => github.com/cosmos/cosmos-proto v1.0.0-beta.2 - // Our cosmos-sdk branch is: https://github.com/osmosis-labs/cosmos-sdk/tree/osmo/v0.47.5, current branch: osmo/v0.47.5. Direct commit link: https://github.com/osmosis-labs/cosmos-sdk/commit/2384e2b96adf19abed82f7320da9ab314bcfba98 - // https://github.com/osmosis-labs/cosmos-sdk/releases/tag/v0.47.5-v24-osmo-5 - github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.47.5-v24-osmo-5 - github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.10 +replace github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.47.5-v25-osmo-1 - github.com/cosmos/iavl => github.com/cosmos/iavl v1.1.2-0.20240405172238-7f92c6b356ac - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 +replace github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.10 - // github.com/osmosis-labs/osmosis/v25 => github.com/osmosis-labs/osmosis/v25 v24.0.0-20240430090414-94186950dcf2 +replace github.com/cosmos/iavl => github.com/cosmos/iavl v1.1.2-0.20240405172238-7f92c6b356ac - github.com/osmosis-labs/sqs/sqsdomain => github.com/osmosis-labs/sqs/sqsdomain v0.0.0-20240429202838-7d69de2c9bea +replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - // replace as directed by sdk upgrading.md https://github.com/cosmos/cosmos-sdk/blob/393de266c8675dc16cc037c1a15011b1e990975f/UPGRADING.md?plain=1#L713 - github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 +replace github.com/osmosis-labs/sqs/sqsdomain => github.com/osmosis-labs/sqs/sqsdomain v0.18.1 - // newer versions of exp treat sorting differently, which is incompatible with the current version of cosmos-sdk - golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb -) +replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + +replace golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb + +replace github.com/osmosis-labs/osmosis/osmomath => github.com/osmosis-labs/osmosis/osmomath v0.0.13 + +replace github.com/osmosis-labs/osmosis/osmoutils => github.com/osmosis-labs/osmosis/osmoutils v0.0.13 + +replace github.com/osmosis-labs/osmosis/x/ibc-hooks => github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.15 diff --git a/packages/osmosis-test-tube/libosmosistesttube/go.sum b/packages/osmosis-test-tube/libosmosistesttube/go.sum index 7e7e5b2e..6d771bff 100644 --- a/packages/osmosis-test-tube/libosmosistesttube/go.sum +++ b/packages/osmosis-test-tube/libosmosistesttube/go.sum @@ -1239,22 +1239,22 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/osmosis-labs/cometbft v0.37.4-v24-osmo-3 h1:mkfU9Hba3vAgGyjXGyATRUzfCT69VLlw9LJmY6aawzs= -github.com/osmosis-labs/cometbft v0.37.4-v24-osmo-3/go.mod h1:p8RohShfTfbvSzgb9zFnqvtCgyLTzqA8otk0I/YDbSg= -github.com/osmosis-labs/cosmos-sdk v0.47.5-v24-osmo-5 h1:fnt89Cw+55vbnIEGkpCmj0cx/EaEnwHfYi4JN3rKkLU= -github.com/osmosis-labs/cosmos-sdk v0.47.5-v24-osmo-5/go.mod h1:eSRUVYwL3eG1jnh01CnBbHiqOM3xJO49p5rTOrSFX1k= -github.com/osmosis-labs/osmosis/osmomath v0.0.12-0.20240423073233-246239a8f662 h1:P6deXtGtSXJgPtvo6f/1vAQgF38HUsrIT6Mq7LMGYrs= -github.com/osmosis-labs/osmosis/osmomath v0.0.12-0.20240423073233-246239a8f662/go.mod h1:ubFhAjLis9cH6GPIhaCjf4JdXrn8HBBOxvOYMxPtgSM= -github.com/osmosis-labs/osmosis/osmoutils v0.0.12-0.20240430090100-86b41c48fe1b h1:VT4eKfFkL9FxuVAO05I06z6Wp6sD99eB7z1ZzaqoMF0= -github.com/osmosis-labs/osmosis/osmoutils v0.0.12-0.20240430090100-86b41c48fe1b/go.mod h1:sHrm1JXicWHDt74cJavXKe19OWongf/kiVX9SBI+Dec= -github.com/osmosis-labs/osmosis/v25 v25.0.0-20240430100100-f8586428a1d5 h1:HYD7dXKzPXraDxzMcCRETE37Pc9zpnm5aPDB9UA0w0w= -github.com/osmosis-labs/osmosis/v25 v25.0.0-20240430100100-f8586428a1d5/go.mod h1:UR3iCTfac3mSMT5QnIVOh2UMh0WA6Qa8ZroY48NPejI= -github.com/osmosis-labs/osmosis/x/epochs v0.0.8-0.20240423073233-246239a8f662 h1:bG3Fll3ryw+yo+70u0oOUjxq1SZ2GgTRDgmivZEdPKE= -github.com/osmosis-labs/osmosis/x/epochs v0.0.8-0.20240423073233-246239a8f662/go.mod h1:3BTKszIZFP/3ut/sW0izJOZRNDXWINU5zfZGo+a8QhE= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.14-0.20240423073233-246239a8f662 h1:1GiW1IDHH6BfmBYdP5YGnS+TkO6ZKKVzSFccG9RH9gA= -github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.14-0.20240423073233-246239a8f662/go.mod h1:VBMzVCCaiVJokiQ+6+O6KAU9XaH656o6kCeHoVCiTL8= -github.com/osmosis-labs/sqs/sqsdomain v0.0.0-20240429202838-7d69de2c9bea h1:jcwN05LSSV7Vdp+FHp3WtabuFtBb7l+ki4O5R2P1Sr4= -github.com/osmosis-labs/sqs/sqsdomain v0.0.0-20240429202838-7d69de2c9bea/go.mod h1:d3wAamev0J2ABDeUvCDTUnw0mMrraXRia1e/dqq/xFI= +github.com/osmosis-labs/cometbft v0.37.4-v25-osmo-2 h1:sEYLujiwT2rMRQVtZbYhEEj8rRGPxszdoqTANqaP3YQ= +github.com/osmosis-labs/cometbft v0.37.4-v25-osmo-2/go.mod h1:p8RohShfTfbvSzgb9zFnqvtCgyLTzqA8otk0I/YDbSg= +github.com/osmosis-labs/cosmos-sdk v0.47.5-v25-osmo-1 h1:l1Hk4DGxDoBe1YUb7IbwRz/CbzA3wfQZ+j+vz+ed5tM= +github.com/osmosis-labs/cosmos-sdk v0.47.5-v25-osmo-1/go.mod h1:eSRUVYwL3eG1jnh01CnBbHiqOM3xJO49p5rTOrSFX1k= +github.com/osmosis-labs/osmosis/osmomath v0.0.13 h1:BqOlG9SxHn8D4RmCbeF4Cg4/2FUobFe+QNxflRTM4QA= +github.com/osmosis-labs/osmosis/osmomath v0.0.13/go.mod h1:eEvmkFLKy1h+EKTr2rhFpmLu4solO3XG0jZt10VSCSI= +github.com/osmosis-labs/osmosis/osmoutils v0.0.13 h1:+9EGL5dSL6JH2AD1TiJ+zhkqcwhtg8hPzAPvcjSpQeU= +github.com/osmosis-labs/osmosis/osmoutils v0.0.13/go.mod h1:lMdKRtlQQk3hOdt/HHrcKnCm3LhxR7PP2/jHFktfiUI= +github.com/osmosis-labs/osmosis/v25 v25.0.0 h1:ukQDYl3zZNI+lIFFlTr/qdpCzg4cm27+o0nFWdhF9Mc= +github.com/osmosis-labs/osmosis/v25 v25.0.0/go.mod h1:CwYI7YMeoiQmpe0OTjJBuwcgfHdtGuijUxDcOoY/XAM= +github.com/osmosis-labs/osmosis/x/epochs v0.0.9 h1:KKNMuoGlGv3yxmh+hF5yIqjYbxjXW8vBDFiCIfZcn78= +github.com/osmosis-labs/osmosis/x/epochs v0.0.9/go.mod h1:jROhCibKGjWW1IyPaCFUIEJ9P25S0VawgIpWRxcqYqQ= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.15 h1:bUBZwiMibgQWQQSqyMPqj0p54hpsDwbkCpNROWdWYJk= +github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.15/go.mod h1:c72yyA6FvQNgOm/NxQuDXQfRpYy2JCJpf1o+G4kFuyM= +github.com/osmosis-labs/sqs/sqsdomain v0.18.1 h1:+jF8VoDUwViU4V8IpkZuuIr7/dc+BqFmxa2j8bx5Khk= +github.com/osmosis-labs/sqs/sqsdomain v0.18.1/go.mod h1:zIr5aJJuPrh/O4C/6ehpdrl1VT6Hs0yjAVP6f/vFJuc= github.com/osmosis-labs/wasmd v0.45.0-osmo h1:NIp7pvJV5HuBN1HwPgEmXKQM2TjVIVdJErIHnB9IMO8= github.com/osmosis-labs/wasmd v0.45.0-osmo/go.mod h1:J6eRvwii5T1WxhetZkBg1kOJS3GTn1Bw2OLyZBb8EVU= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= diff --git a/packages/osmosis-test-tube/osmosis b/packages/osmosis-test-tube/osmosis index be79c767..15566f1f 160000 --- a/packages/osmosis-test-tube/osmosis +++ b/packages/osmosis-test-tube/osmosis @@ -1 +1 @@ -Subproject commit be79c767d6f51327a3351d942768b68a56ac4abf +Subproject commit 15566f1f2945a16af9243dd376ee58a0d691b66a diff --git a/packages/osmosis-test-tube/src/module/authz.rs b/packages/osmosis-test-tube/src/module/authz.rs index 2c576aa5..a688cb63 100644 --- a/packages/osmosis-test-tube/src/module/authz.rs +++ b/packages/osmosis-test-tube/src/module/authz.rs @@ -92,6 +92,7 @@ mod tests { amount: 10u128.to_string(), denom: "usdc".to_string(), }], + allow_list: vec![], }, &mut buf, ) diff --git a/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs b/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs index 40188782..82778f35 100644 --- a/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs +++ b/packages/osmosis-test-tube/src/module/concentrated_liquidity.rs @@ -107,10 +107,10 @@ mod tests { fn test_concentrated_liquidity() { let app = OsmosisTestApp::new(); let signer = app - .init_account(&[Coin::new(10_000_000_000, "uosmo")]) + .init_account(&[Coin::new(10_000_000_000u128, "uosmo")]) .unwrap() .with_fee_setting(test_tube::account::FeeSetting::Auto { - gas_price: Coin::new(25, "uosmo"), + gas_price: Coin::new(25u128, "uosmo"), gas_adjustment: 1.2, }); @@ -136,7 +136,7 @@ mod tests { .mint( MsgMint { sender: signer.address(), - amount: Some(Coin::new(100_000_000_000, &denom0).into()), + amount: Some(Coin::new(100_000_000_000u128, &denom0).into()), mint_to_address: signer.address(), }, &signer, diff --git a/packages/osmosis-test-tube/src/module/gov.rs b/packages/osmosis-test-tube/src/module/gov.rs index 044f9a4b..33619bd6 100644 --- a/packages/osmosis-test-tube/src/module/gov.rs +++ b/packages/osmosis-test-tube/src/module/gov.rs @@ -173,7 +173,7 @@ mod tests { let gov = GovWithAppAccess::new(&app); let proposer = app - .init_account(&[cosmwasm_std::Coin::new(1000000000000000000, "uosmo")]) + .init_account(&[cosmwasm_std::Coin::new(1000000000000000000u128, "uosmo")]) .unwrap(); // upload cosmwasm pool code and whitelist through proposal diff --git a/packages/osmosis-test-tube/src/module/pool_manager.rs b/packages/osmosis-test-tube/src/module/pool_manager.rs index 00950f9d..7429dea5 100644 --- a/packages/osmosis-test-tube/src/module/pool_manager.rs +++ b/packages/osmosis-test-tube/src/module/pool_manager.rs @@ -117,10 +117,10 @@ mod tests { fn test_pool_manager() { let app = OsmosisTestApp::new(); let signer = app - .init_account(&[Coin::new(1_000_000_000_000_000, "uosmo")]) + .init_account(&[Coin::new(1_000_000_000_000_000u128, "uosmo")]) .unwrap() .with_fee_setting(test_tube::account::FeeSetting::Auto { - gas_price: Coin::new(25, "uosmo"), + gas_price: Coin::new(25u128, "uosmo"), gas_adjustment: 1.2, }); @@ -160,7 +160,7 @@ mod tests { .mint( MsgMint { sender: signer.address(), - amount: Some(Coin::new(10_000_000_000_000, &denom0).into()), + amount: Some(Coin::new(10_000_000_000_000u128, &denom0).into()), mint_to_address: signer.address(), }, &signer, @@ -171,7 +171,7 @@ mod tests { .mint( MsgMint { sender: signer.address(), - amount: Some(Coin::new(100_000_000_000, &denom1).into()), + amount: Some(Coin::new(100_000_000_000u128, &denom1).into()), mint_to_address: signer.address(), }, &signer, @@ -181,8 +181,8 @@ mod tests { // create pool 1 gamm.create_basic_pool( &[ - Coin::new(1_000_000_000, denom0.clone()), - Coin::new(2_000_000_000, denom1.clone()), + Coin::new(1_000_000_000u128, denom0.clone()), + Coin::new(2_000_000_000u128, denom1.clone()), ], &signer, ) @@ -279,8 +279,8 @@ mod tests { // swap amount in let trader = app .init_account(&[ - Coin::new(1_000_000_000, denom0.clone()), - Coin::new(1_000_000_000, "uosmo".to_string()), + Coin::new(1_000_000_000u128, denom0.clone()), + Coin::new(1_000_000_000u128, "uosmo".to_string()), ]) .unwrap(); diff --git a/packages/osmosis-test-tube/src/module/tokenfactory.rs b/packages/osmosis-test-tube/src/module/tokenfactory.rs index 7fde74c7..5dd83f04 100644 --- a/packages/osmosis-test-tube/src/module/tokenfactory.rs +++ b/packages/osmosis-test-tube/src/module/tokenfactory.rs @@ -73,7 +73,7 @@ mod tests { fn tokenfactory_integration() { let app = OsmosisTestApp::new(); let signer = app - .init_account(&[Coin::new(2_000_000_000_000, "uosmo")]) + .init_account(&[Coin::new(2_000_000_000_000u128, "uosmo")]) .unwrap(); let tokenfactory = TokenFactory::new(&app); let bank = Bank::new(&app); @@ -106,7 +106,7 @@ mod tests { // mint let coin: osmosis_std::types::cosmos::base::v1beta1::Coin = - Coin::new(1000000000, denom.clone()).into(); + Coin::new(1000000000u128, denom.clone()).into(); tokenfactory .mint( MsgMint { diff --git a/packages/osmosis-test-tube/src/module/twap.rs b/packages/osmosis-test-tube/src/module/twap.rs index ccc02081..39385d98 100644 --- a/packages/osmosis-test-tube/src/module/twap.rs +++ b/packages/osmosis-test-tube/src/module/twap.rs @@ -56,10 +56,10 @@ mod tests { fn test_twap() { let app = OsmosisTestApp::new(); let signer = app - .init_account(&[Coin::new(1_000_000_000_000_000, "uosmo")]) + .init_account(&[Coin::new(1_000_000_000_000_000u128, "uosmo")]) .unwrap() .with_fee_setting(test_tube::account::FeeSetting::Auto { - gas_price: Coin::new(25, "uosmo"), + gas_price: Coin::new(25u128, "uosmo"), gas_adjustment: 1.2, }); @@ -98,7 +98,7 @@ mod tests { .mint( MsgMint { sender: signer.address(), - amount: Some(Coin::new(10_000_000_000_000, &denom0).into()), + amount: Some(Coin::new(10_000_000_000_000u128, &denom0).into()), mint_to_address: signer.address(), }, &signer, @@ -109,7 +109,7 @@ mod tests { .mint( MsgMint { sender: signer.address(), - amount: Some(Coin::new(100_000_000_000, &denom1).into()), + amount: Some(Coin::new(100_000_000_000u128, &denom1).into()), mint_to_address: signer.address(), }, &signer, @@ -119,8 +119,8 @@ mod tests { // create pool 1 gamm.create_basic_pool( &[ - Coin::new(1_000_000_000, denom0.clone()), - Coin::new(2_000_000_000, denom1.clone()), + Coin::new(1_000_000_000u128, denom0.clone()), + Coin::new(2_000_000_000u128, denom1.clone()), ], &signer, ) diff --git a/packages/osmosis-test-tube/src/runner/app.rs b/packages/osmosis-test-tube/src/runner/app.rs index 7e4e18bb..965a2531 100644 --- a/packages/osmosis-test-tube/src/runner/app.rs +++ b/packages/osmosis-test-tube/src/runner/app.rs @@ -277,7 +277,7 @@ mod tests { .init_accounts(&coins(100_000_000_000, "uosmo"), 3) .unwrap(); - assert!(accounts.get(0).is_some()); + assert!(accounts.first().is_some()); assert!(accounts.get(1).is_some()); assert!(accounts.get(2).is_some()); assert!(accounts.get(3).is_none()); @@ -399,14 +399,14 @@ mod tests { let app = OsmosisTestApp::default(); let alice = app .init_account(&[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ]) .unwrap(); let gamm = Gamm::new(&app); - let pool_liquidity = vec![Coin::new(1_000, "uatom"), Coin::new(1_000, "uosmo")]; + let pool_liquidity = vec![Coin::new(1_000u128, "uatom"), Coin::new(1_000u128, "uosmo")]; let pool_id = gamm .create_basic_pool(&pool_liquidity, &alice) .unwrap() @@ -445,8 +445,8 @@ mod tests { let accs = app .init_accounts( &[ - Coin::new(1_000_000_000_000, "uatom"), - Coin::new(1_000_000_000_000, "uosmo"), + Coin::new(1_000_000_000_000u128, "uatom"), + Coin::new(1_000_000_000_000u128, "uosmo"), ], 2, ) @@ -513,7 +513,7 @@ mod tests { let alice = app.init_account(&coins(initial_balance, "uosmo")).unwrap(); let bob = app.init_account(&coins(initial_balance, "uosmo")).unwrap(); - let amount = Coin::new(1_000_000, "uosmo"); + let amount = Coin::new(1_000_000u128, "uosmo"); let gas_limit = 100_000_000; // use FeeSetting::Auto by default, so should not equal newly custom fee setting @@ -584,8 +584,8 @@ mod tests { let app = OsmosisTestApp::default(); let balances = vec![ - Coin::new(1_000_000_000_000, "uosmo"), - Coin::new(1_000_000_000_000, "uion"), + Coin::new(1_000_000_000_000u128, "uosmo"), + Coin::new(1_000_000_000_000u128, "uion"), ]; let whitelisted_user = app.init_account(&balances).unwrap(); @@ -593,7 +593,10 @@ mod tests { let gamm = Gamm::new(&app); let pool_id = gamm .create_basic_pool( - &[Coin::new(1_000_000, "uosmo"), Coin::new(1_000_000, "uion")], + &[ + Coin::new(1_000_000u128, "uosmo"), + Coin::new(1_000_000u128, "uion"), + ], &whitelisted_user, ) .unwrap() diff --git a/packages/osmosis-test-tube/src/runner/mod.rs b/packages/osmosis-test-tube/src/runner/mod.rs index 0b8fbb14..bc5fb2a2 100644 --- a/packages/osmosis-test-tube/src/runner/mod.rs +++ b/packages/osmosis-test-tube/src/runner/mod.rs @@ -106,7 +106,7 @@ mod tests { #[test] fn test_raw_result_ptr_with_0_bytes_in_content_should_not_error() { let base64_string = - base64::engine::general_purpose::STANDARD.encode(vec![vec![0u8], vec![0u8]].concat()); + base64::engine::general_purpose::STANDARD.encode([vec![0u8], vec![0u8]].concat()); let res = unsafe { RawResult::from_ptr( CString::new(base64_string.as_bytes().to_vec()) @@ -125,14 +125,14 @@ mod tests { fn test_execute_cosmos_msgs() { let app = OsmosisTestApp::new(); let signer = app - .init_account(&[Coin::new(1000000000000, "uosmo")]) + .init_account(&[Coin::new(1000000000000u128, "uosmo")]) .unwrap(); let bank = Bank::new(&app); // BankMsg::Send let to = app.init_account(&[]).unwrap(); - let coin = Coin::new(100, "uosmo"); + let coin = Coin::new(100u128, "uosmo"); let send_msg = CosmosMsg::Bank(BankMsg::Send { to_address: to.address(), amount: vec![coin], diff --git a/packages/test-tube/Cargo.toml b/packages/test-tube/Cargo.toml index dfbf6281..6730bf0b 100644 --- a/packages/test-tube/Cargo.toml +++ b/packages/test-tube/Cargo.toml @@ -4,15 +4,15 @@ edition = "2021" license = "MIT OR Apache-2.0" name = "test-tube" repository = "https://github.com/osmosis-labs/test-tube" -version = "0.6.0" +version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] base64 = "0.21.5" -cosmrs = {version = "0.15.0", features = ["cosmwasm", "rpc"]} -cosmwasm-std = {version = "1.4.0", features = ["stargate"]} -osmosis-std = {git = " https://github.com/osmosis-labs/osmosis-rust", branch = "main", optional = true} +cosmrs = { version = "0.15.0", features = ["cosmwasm", "rpc"] } +cosmwasm-std = { version = "1.5.5", features = ["stargate"] } +osmosis-std = { version = "0.25.0", optional = true } prost = "0.12.3" serde = "1.0.144" serde_json = "1.0.85" diff --git a/packages/test-tube/src/runner/mod.rs b/packages/test-tube/src/runner/mod.rs index 80e88759..9f47a766 100644 --- a/packages/test-tube/src/runner/mod.rs +++ b/packages/test-tube/src/runner/mod.rs @@ -58,7 +58,7 @@ pub trait Runner<'a> { CosmosMsg::Bank(msg) => bank_msg_to_any(msg, signer), CosmosMsg::Stargate { type_url, value } => Ok(cosmrs::Any { type_url: type_url.clone(), - value: value.0.clone(), + value: value.to_vec(), }), CosmosMsg::Wasm(msg) => wasm_msg_to_any(msg, signer), _ => todo!("unsupported cosmos msg variant"), diff --git a/packages/test-tube/src/runner/result.rs b/packages/test-tube/src/runner/result.rs index f9543530..8e325750 100644 --- a/packages/test-tube/src/runner/result.rs +++ b/packages/test-tube/src/runner/result.rs @@ -38,7 +38,7 @@ where .msg_responses // since this tx contains exactly 1 msg // when getting none of them, that means error - .get(0) + .first() .ok_or(RunnerError::ExecuteError { msg: res.log })?; let data = R::decode(msg_data.value.as_slice()).map_err(DecodeError::ProtoDecodeError)?; @@ -88,7 +88,7 @@ where .msg_responses // since this tx contains exactly 1 msg // when getting none of them, that means error - .get(0) + .first() .ok_or(RunnerError::ExecuteError { msg: res.log })?; let data = R::decode(msg_data.value.as_slice()).map_err(DecodeError::ProtoDecodeError)?; @@ -137,7 +137,7 @@ where .msg_responses // since this tx contains exactly 1 msg // when getting none of them, that means error - .get(0) + .first() .ok_or(RunnerError::ExecuteError { msg: res.log })?; let data = R::decode(msg_data.value.as_slice()).map_err(DecodeError::ProtoDecodeError)?; diff --git a/scripts/update-osmosis-test-tube-deps/go.mod b/scripts/update-osmosis-test-tube-deps/go.mod index fd16206d..30207728 100644 --- a/scripts/update-osmosis-test-tube-deps/go.mod +++ b/scripts/update-osmosis-test-tube-deps/go.mod @@ -1,5 +1,5 @@ module github.com/osmosis-labs/osmosis-rust/update-osmosis-test-tube-deps -go 1.19 +go 1.21 -require golang.org/x/mod v0.7.0 +require golang.org/x/mod v0.17.0 diff --git a/scripts/update-osmosis-test-tube-deps/go.sum b/scripts/update-osmosis-test-tube-deps/go.sum index f6b0ac09..e69cc374 100644 --- a/scripts/update-osmosis-test-tube-deps/go.sum +++ b/scripts/update-osmosis-test-tube-deps/go.sum @@ -1,2 +1,2 @@ -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= diff --git a/test_contracts/simple-sudo/src/contract.rs b/test_contracts/simple-sudo/src/contract.rs index 2fcad1f5..6d26b364 100644 --- a/test_contracts/simple-sudo/src/contract.rs +++ b/test_contracts/simple-sudo/src/contract.rs @@ -13,7 +13,7 @@ pub fn instantiate( _info: MessageInfo, _msg: InstantiateMsg, ) -> Result { - return Ok(Response::default()); + Ok(Response::default()) } #[cfg_attr(not(feature = "library"), entry_point)]