Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cw orch core 2.0 changes #470

Merged
merged 26 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
704876e
Started cosmwasm-std2 change
Kayanski May 13, 2024
b4ba09f
Updated and merged
Kayanski Jun 9, 2024
65e5f3d
Nit
Kayanski Jun 9, 2024
acfaac9
Update
Kayanski Jun 9, 2024
3b24dd1
Check all features work
Kayanski Jun 9, 2024
441be3a
Update
Kayanski Jun 9, 2024
7ee0f35
formatting
Kayanski Jun 9, 2024
af5e0e5
Merge remote-tracking branch 'origin/main' into update/cosmwasm-std-2
Buckram123 Aug 14, 2024
f74fff8
Make bumps and compilable
Buckram123 Aug 14, 2024
98b04d9
fix tests
Buckram123 Aug 14, 2024
2f7d17b
test fixes
Buckram123 Aug 15, 2024
889eae6
fix interchain tests and doctests
Buckram123 Aug 15, 2024
08bf4e6
move compatibility test
Buckram123 Aug 15, 2024
9cea8d4
clippy
Buckram123 Aug 15, 2024
fce3133
Cosmwasm2 accept addr (#467)
Buckram123 Aug 16, 2024
98039d1
return TxHandler::Sender type for TxHandler::sender()
Buckram123 Aug 16, 2024
9c773be
Update coins usage
Buckram123 Aug 16, 2024
231af5e
Merge remote-tracking branch 'origin/main' into misha/orc-153-release…
Buckram123 Aug 16, 2024
82e281f
Traits refactor
Buckram123 Aug 16, 2024
4a390d6
rename cosmwasm_environment.rs to tx_handler.rs and move CwEnv, MutEn…
Buckram123 Aug 16, 2024
e9e2be5
Bump all possible dependencies
Buckram123 Aug 19, 2024
1de62b6
remove unused
Buckram123 Aug 19, 2024
6ff13f6
apply suggestions
Buckram123 Aug 19, 2024
252215f
bump msrv
Buckram123 Aug 19, 2024
706e92f
nits
Buckram123 Aug 19, 2024
df8064e
Merge remote-tracking branch 'origin/main' into misha/orc-153-release…
Buckram123 Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: [1.75.0] # dep/feat syntax fixed with co-exist dep
msrv: [1.76.0] # dep/feat syntax fixed with co-exist dep
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 13 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ repository = "https://github.com/AbstractSDK/cw-orchestrator"

[workspace.dependencies]
cw-utils = { version = "2.0.0" }
cosmwasm-std = { version = "2.0" }
cosmwasm-std = { version = "2.1" }
cw-storage-plus = { version = "2.0.0" }
cosmos-sdk-proto = { version = "0.22.0", default-features = false } # https://github.com/cosmos/cosmos-rust/issues/497

cw-multi-test = { package = "abstract-cw-multi-test", version = "2.0.0", features = [
cw-multi-test = { package = "abstract-cw-multi-test", version = "2.0.2", features = [
"cosmwasm_1_2",
] }
cw20 = { package = "abstract-cw20", version = "3.0.0" }
Expand All @@ -36,8 +37,8 @@ cw20-base = { package = "abstract-cw20-base", version = "3.0.0" }
osmosis-test-tube = { version = "25.0.0" }

anyhow = "1.0"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
tokio = { version = "1.4", features = ["full"] }
serde = { version = "1.0.208", default-features = false, features = ["derive"] }
tokio = { version = "1.39", features = ["full"] }

cw-orch = { path = "./cw-orch", version = "0.25.0" }
cw-orch-daemon = { path = "./cw-orch-daemon", version = "0.25.0" }
Expand All @@ -64,19 +65,19 @@ cw-orch-proto = { path = "packages/interchain/proto", version = "0.5.0" }
#Clone Testing
# cw-orch-clone-testing = { version = "0.6.1", path = "packages/clone-testing" }

thiserror = { version = "1.0.21" }
thiserror = { version = "1.0.63" }
sha2 = { version = "0.10.8" }
serde_json = "1.0.79"
tonic = { version = "0.10.2" }
serde_json = "1.0.125"
tonic = { version = "0.11.0" }
prost-types = "0.12.3"
prost = "0.12.3"
cosmrs = { version = "0.15.0" }
prost = "0.12.3" # prost, tonic, cosmrs bump locked by osmosis (we use it for tokenfactory
cosmrs = { version = "0.17.0" }
# Test deps
speculoos = "0.11.0"

# Logging
log = "0.4.14"
log = "0.4.22"

# Interchain
ibc-relayer-types = { version = "0.25.0" }
ibc-chain-registry = { version = "0.25.0" }
ibc-relayer-types = { version = "0.29.2" }
ibc-chain-registry = { version = "0.29.2" }
8 changes: 4 additions & 4 deletions contracts-ws/contracts/counter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export = []
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = "2.0"
cosmwasm-schema = "1.2"
schemars = "0.8.10"
thiserror = { version = "1.0.21" }
cosmwasm-schema = "2.1"
schemars = "0.8.21"
thiserror = { version = "1.0.63" }
serde = { workspace = true }
serde_json = "1.0.79"
serde_json = "1.0.125"
cw-orch = { workspace = true, features = ["daemon"] }
# Unused, only there to check for wasm compatibility
cw-orch-interchain = { workspace = true, features = ["daemon"] }
Expand Down
2 changes: 1 addition & 1 deletion contracts-ws/contracts/counter/examples/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn main() -> anyhow::Result<()> {

// ANCHOR: clean_example
counter.upload()?;
counter.instantiate(&InstantiateMsg { count: 0 }, None, None)?;
counter.instantiate(&InstantiateMsg { count: 0 }, None, &[])?;

counter.increment()?;

Expand Down
2 changes: 1 addition & 1 deletion contracts-ws/contracts/counter/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl CounterContract<Daemon> {

// Instantiate the contract
let msg = InstantiateMsg { count: 1i32 };
contract.instantiate(&msg, None, None).unwrap();
contract.instantiate(&msg, None, &[]).unwrap();

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion contracts-ws/contracts/counter/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn setup<Chain: CwEnv>(chain: Chain) -> anyhow::Result<CounterContract<Chain>> {

// Instantiate the contract
let msg = InstantiateMsg { count: 1i32 };
let init_resp = contract.instantiate(&msg, Some(&admin), None)?;
let init_resp = contract.instantiate(&msg, Some(&admin), &[])?;

// Get the address from the response
let contract_addr = init_resp.instantiated_contract_address()?;
Expand Down
8 changes: 4 additions & 4 deletions contracts-ws/contracts/mock_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ interface = []
cosmwasm-std = { workspace = true }
cw2 = { version = "2.0.0" }
serde = { workspace = true }
schemars = "0.8.10"
serde_json = "1.0.79"
thiserror = { version = "1.0.21" }
cosmwasm-schema = "1.2"
schemars = "0.8.21"
serde_json = "1.0.125"
thiserror = { version = "1.0.63" }
cosmwasm-schema = "2.1"
cw-orch = { workspace = true }
cw-storage-plus = { workspace = true }
4 changes: 2 additions & 2 deletions contracts-ws/contracts/mock_contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ mod test {
let contract = LocalMockContract::new("mock-contract", mock.clone());

contract.upload()?;
contract.instantiate(&InstantiateMsg {}, None, None)?;
contract.instantiate(&InstantiateMsg {}, None, &[])?;
contract.first_message()?;
contract
.second_message("s", &coins(156, "ujuno"))
Expand Down Expand Up @@ -249,7 +249,7 @@ mod test {
let contract = LocalMockContract::new("mock-contract", mock.clone());

contract.upload()?;
contract.instantiate(&InstantiateMsg {}, None, None)?;
contract.instantiate(&InstantiateMsg {}, None, &[])?;

let cw2_info: cw2::ContractVersion = from_json(
mock.wasm_querier()
Expand Down
4 changes: 2 additions & 2 deletions contracts-ws/contracts/mock_contract/src/msg_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ mod test {

contract.upload()?;
contract_ordered.upload()?;
contract.instantiate(&Empty {}, None, None)?;
contract_ordered.instantiate(&Empty {}, None, None)?;
contract.instantiate(&Empty {}, None, &[])?;
contract_ordered.instantiate(&Empty {}, None, &[])?;

contract.test(5u64, "test")?;
contract_ordered.test("test".to_string(), 5u64)?;
Expand Down
8 changes: 4 additions & 4 deletions contracts-ws/contracts/mock_contract_u64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export = []
[dependencies]
cosmwasm-std = { workspace = true }
serde = { workspace = true }
schemars = "0.8.10"
serde_json = "1.0.79"
thiserror = { version = "1.0.21" }
cosmwasm-schema = "1.2"
schemars = "0.8.21"
serde_json = "1.0.125"
thiserror = { version = "1.0.63" }
cosmwasm-schema = "2.1"
cw-orch = { workspace = true }

mock-contract = { path = "../mock_contract" }
2 changes: 1 addition & 1 deletion contracts-ws/contracts/mock_contract_u64/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mod test {
let contract = LocalMockContract::new(mock.clone());

contract.upload()?;
contract.instantiate(&InstantiateMsg {}, None, None)?;
contract.instantiate(&InstantiateMsg {}, None, &[])?;
contract.first_message()?;
contract.second_message(54u64, &[]).unwrap_err();
contract.third_message(54u64).unwrap();
Expand Down
45 changes: 23 additions & 22 deletions cw-orch-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,45 @@ cw-orch-networks = { workspace = true }
cosmwasm-std = { workspace = true }
anyhow = { workspace = true }
serde = { workspace = true }
schemars = "0.8.10"
schemars = "0.8.21"
log = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }

prost-types = { workspace = true }
# Daemon deps
sha2 = { workspace = true }
prost = { version = "0.12.3" }
bitcoin = { version = "0.30.0" }
prost = { workspace = true }
bitcoin = { version = "0.32.2" }
bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] }
hex = { version = "0.4.3" }
ripemd = { version = "0.1.3" }
tokio = { workspace = true, features = ["full"] }
tonic = { workspace = true, features = ["tls", "tls-roots"] }
reqwest = { version = "0.11.9" }
reqwest = { version = "0.12.5" }
base64 = { version = "0.22.1" }
hkd32 = { version = "0.7.0", features = ["bip39", "mnemonic", "bech32"] }
rand_core = { version = "0.6.4", default-features = false }
ed25519-dalek = { version = "2", features = ["serde"] }
eyre = { version = "0.6" }
cosmrs = { version = "0.15.0", features = ["dev", "cosmwasm", "grpc"] }
cosmrs = { workspace = true, features = ["dev", "cosmwasm", "grpc"] }
chrono = { version = "0.4" }
base16 = { version = "0.2.1" }
ring = { version = "0.17.3" }
ring = { version = "0.17.8" }
dirs = "5.0.1"


# Injective dependencies
ethers-signers = { version = "2.0.7", optional = true }
ethers-core = { version = "2.0.7", optional = true }
async-recursion = "1.0.5"
ethers-signers = { version = "2.0.14", optional = true }
ethers-core = { version = "2.0.14", optional = true }
async-recursion = "1.1.1"

# Gzip
flate2 = { version = "1.0.26" }
lazy_static = "1.4.0"
flate2 = { version = "1.0.31" }
lazy_static = "1.5.0"

# Lock daemon
file-lock = { version = "2.1.10" }
file-lock = { version = "2.1.11" }
once_cell = { version = "1.19.0" }

# Tempfile names
Expand All @@ -80,25 +81,25 @@ toml = "0.8"
[dev-dependencies]
cw-orch-daemon = { path = "." }
cw-orch = { path = "../cw-orch", features = ["daemon"] }
env_logger = "0.11.2"
cw20 = { version = "1" }
cw20-base = { version = "1" }
cosmwasm-schema = "1.2"
env_logger = "0.11.5"
cw20 = { version = "2" }
cw20-base = { version = "2" }
cosmwasm-schema = "2.1"
speculoos = "0.11.0"
ctor = "0.2.0"
ctor = "0.2.8"
duct = "0.13"
mock-contract = { path = "../contracts-ws/contracts/mock_contract", features = [
"interface",
] }
serial_test = { version = "3.0.0" }
serial_test = { version = "3.1.1" }

# Ethereum deps
ethers-signers = { version = "2.0.7" }
ethers-core = { version = "2.0.7" }
tokio-test = "0.4.3"
ethers-signers = { version = "2.0.14" }
ethers-core = { version = "2.0.14" }
tokio-test = "0.4.4"

# File lock test
nix = { version = "0.28.0", features = ["process"] }
nix = { version = "0.29.0", features = ["process"] }
counter-contract = { path = "../contracts-ws/contracts/counter" }
dotenv = "0.15.0"
pretty_env_logger = "0.5.0"
2 changes: 1 addition & 1 deletion cw-orch-daemon/examples/batch-sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn main() -> anyhow::Result<()> {
let counter = CounterContract::new(chain.clone());

counter.upload()?;
counter.instantiate(&InstantiateMsg { count: 0 }, None, None)?;
counter.instantiate(&InstantiateMsg { count: 0 }, None, &[])?;

counter.increment()?;

Expand Down
5 changes: 2 additions & 3 deletions cw-orch-daemon/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ pub enum DaemonError {
MissingPhrase,
#[error("Bad Implementation. Missing Component")]
Implementation,
#[error("Unable to convert into public key `{key}`")]
#[error("Unable to convert into public key `{key}`: {source}")]
Conversion {
key: String,
source: bitcoin::bech32::Error,
source: bech32::DecodeError,
},
#[error("Can not augment daemon deployment after usage in more than one contract.")]
SharedDaemonState,
#[error(transparent)]
ErrReport(#[from] ::eyre::ErrReport),
#[error(transparent)]
GRpcDecodeError(#[from] ::prost::DecodeError),

#[error(transparent)]
ED25519(#[from] ::ed25519_dalek::ed25519::Error),
#[error(transparent)]
Expand Down
10 changes: 4 additions & 6 deletions cw-orch-daemon/src/keys/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use ::ethers_core::k256::ecdsa::SigningKey;
use base64::Engine;
use bitcoin::secp256k1::{self, Secp256k1};
use bitcoin::{
bip32::{ExtendedPrivKey, IntoDerivationPath},
bip32::{IntoDerivationPath, Xpriv},
Network,
};
use cosmrs::tx::SignerPublicKey;
Expand All @@ -29,9 +29,9 @@ pub struct PrivateKey {
mnemonic: Option<Phrase>,
#[allow(dead_code)]
/// This is used for testing
root_private_key: ExtendedPrivKey,
root_private_key: Xpriv,
/// The private key
private_key: ExtendedPrivKey,
private_key: Xpriv,
}
impl PrivateKey {
/// Generate a new private key
Expand Down Expand Up @@ -189,7 +189,7 @@ impl PrivateKey {
index: u32,
coin_type: u32,
) -> Result<PrivateKey, DaemonError> {
let root_private_key = ExtendedPrivKey::new_master(Network::Bitcoin, raw_key).unwrap();
let root_private_key = Xpriv::new_master(Network::Bitcoin, raw_key).unwrap();
// For injective: https://docs.injective.network/learn/basic-concepts/accounts#injective-accounts
let path = format!("m/44'/{coin_type}'/{account}'/0/{index}");
let derivation_path = path.into_derivation_path()?;
Expand Down Expand Up @@ -221,8 +221,6 @@ impl PrivateKey {
#[cfg(test)]
mod tst {
use base64::{engine::general_purpose, Engine};
use bitcoin::bech32::ToBase32;
use bitcoin::bech32::{Bech32Writer, Variant};
use ethers_core::k256::ecdsa::SigningKey;
use ethers_signers::{coins_bip39::English, MnemonicBuilder, Signer};

Expand Down
Loading
Loading