Skip to content

Commit 89e9ac8

Browse files
authored
Merge branch 'main' into soroban/xcall-multi
2 parents 4dd83e0 + 3284b2f commit 89e9ac8

File tree

88 files changed

+6740
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6740
-558
lines changed

.github/workflows/basic-rust.yml

+2-16
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
push:
1313
branches:
1414
- main
15-
15+
1616
jobs:
1717

1818
test:
@@ -23,20 +23,13 @@ jobs:
2323
- name: Checkout sources
2424
uses: actions/checkout@v3
2525

26-
- name: Install Rust
27-
run: rustup update stable
28-
2926
- name: Cache Rust dependencies
3027
uses: Swatinem/rust-cache@v2
3128

3229
- name: Run unit tests
3330
run: |
3431
RUST_BACKTRACE=1 cargo unit-test --locked
3532
36-
- name: Install wasm32
37-
run: |
38-
rustup target add wasm32-unknown-unknown
39-
4033
- name: Compile WASM contract
4134
run: |
4235
RUSTFLAGS='-C link-arg=-s' cargo wasm --locked
@@ -51,16 +44,9 @@ jobs:
5144
- name: Checkout sources
5245
uses: actions/checkout@v3
5346

54-
- name: Install Rust
55-
run: rustup update stable
56-
5747
- name: Cache Rust dependencies
5848
uses: Swatinem/rust-cache@v2
59-
60-
- name: Run cargo fmt
61-
run: |
62-
cargo fmt --all -- --check
63-
49+
6450
- name: Run cargo clippy
6551
run: |
6652
cargo clippy

.github/workflows/build-and-publish-cosmwasm.yml

-13
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,8 @@ jobs:
2020
with:
2121
submodules: true
2222

23-
- name: Install stable toolchain
24-
uses: actions-rs/toolchain@v1
25-
with:
26-
toolchain: 1.69.0
27-
target: wasm32-unknown-unknown
28-
override: true
29-
profile: minimal
30-
31-
- name: Cache Rust dependencies
32-
uses: Swatinem/rust-cache@v2
33-
3423
- name: Compile WASM
3524
run: |
36-
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
37-
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
3825
bash ./scripts/optimize-cosmwasm.sh
3926
4027
- name: Archive artifacts

.github/workflows/cosmwasm-contracts-code-coverage.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ jobs:
2525
uses: actions/checkout@v3
2626
with:
2727
submodules: true
28-
- name: Install Rust
29-
run: rustup update stable
30-
- name: Cache Rust dependencies
31-
uses: Swatinem/rust-cache@v2
28+
3229
- name: Install cargo-llvm-cov
3330
uses: taiki-e/install-action@cargo-llvm-cov
3431
- name: Generate code coverage

.github/workflows/deploy-cosmwasm-contracts.yml

-13
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,8 @@ jobs:
2323
cp ./scripts/archway/docker_compose_archway.yaml .
2424
docker compose -f docker_compose_archway.yaml up -d
2525
26-
- name: Install stable toolchain
27-
uses: actions-rs/toolchain@v1
28-
with:
29-
toolchain: 1.69.0
30-
target: wasm32-unknown-unknown
31-
override: true
32-
profile: minimal
33-
34-
- name: Cache Rust dependencies
35-
uses: Swatinem/rust-cache@v2
36-
3726
- name: Compile WASM
3827
run: |
39-
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
40-
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
4128
sudo chmod -R 777 artifacts
4229
sudo chmod -R 777 scripts
4330
bash ./scripts/optimize-cosmwasm.sh

.github/workflows/release.yml

+9-15
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
./gradlew optimizedJar
2626
./gradlew zipOutputOptimizedJars
2727
- name: Upload Artifacts
28-
uses: actions/upload-artifact@v3
28+
uses: actions/upload-artifact@v4
2929
with:
3030
name: javascore-contracts
3131
path: ./contracts/javascore/build/javascore-contracts.zip
@@ -37,24 +37,18 @@ jobs:
3737
uses: actions/checkout@v3
3838
with:
3939
submodules: true
40-
- name: Install stable toolchain
41-
uses: actions-rs/toolchain@v1
42-
with:
43-
toolchain: 1.69.0
44-
target: wasm32-unknown-unknown
45-
override: true
46-
profile: minimal
40+
4741
- name: Cache Rust dependencies
4842
uses: Swatinem/rust-cache@v2
4943
- name: Compile WASM
5044
run: |
51-
rustup component add rustfmt --toolchain 1.69.0-x86_64-unknown-linux-gnu
52-
rustup component add clippy --toolchain 1.69.0-x86_64-unknown-linux-gnu
45+
# rustup component add rustfmt --toolchain 1.78.0-x86_64-unknown-linux-gnu
46+
# rustup component add clippy --toolchain 1.78.0-x86_64-unknown-linux-gnu
5347
bash ./scripts/optimize-cosmwasm.sh
5448
cd artifacts/archway && zip -r ../../cosmwasm-contracts.zip . -j
5549
5650
- name: Upload Artifacts
57-
uses: actions/upload-artifact@v3
51+
uses: actions/upload-artifact@v4
5852
with:
5953
name: cosmwasm-contracts
6054
path: cosmwasm-contracts.zip
@@ -79,7 +73,7 @@ jobs:
7973
cd artifacts && zip -r ../../../solidity-contracts.zip . -j
8074
8175
- name: Upload Artifacts
82-
uses: actions/upload-artifact@v3
76+
uses: actions/upload-artifact@v4
8377
with:
8478
name: solidity-contracts
8579
path: solidity-contracts.zip
@@ -96,19 +90,19 @@ jobs:
9690
echo «::set-output name=date::$(date +'%Y-%m-%d')»
9791
echo «::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)»
9892
- name: Download Javascore Artifacts
99-
uses: actions/download-artifact@v2
93+
uses: actions/download-artifact@v4
10094
with:
10195
name: javascore-contracts
10296
path: javascore-contracts
10397

10498
- name: Download Cosmwasm Artifacts
105-
uses: actions/download-artifact@v2
99+
uses: actions/download-artifact@v4
106100
with:
107101
name: cosmwasm-contracts
108102
path: cosmwasm-contracts
109103

110104
- name: Download Solidity Artifacts
111-
uses: actions/download-artifact@v2
105+
uses: actions/download-artifact@v4
112106
with:
113107
name: solidity-contracts
114108
path: solidity-contracts
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: SUI Move Build and Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
push:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
build:
13+
name: sui move build and test
14+
runs-on: ubuntu-latest
15+
env:
16+
GH_TOKEN: ${{ github.token }}
17+
REPO_OWNER: MystenLabs
18+
REPO_NAME: sui
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
submodules: recursive
23+
24+
- name: Install sui
25+
run: bash -x ./scripts/install_sui.sh
26+
27+
- name: build and test
28+
run: bash ./scripts/optimize-move.sh
29+

.gitmodules

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
77
[submodule "contracts/evm/xcall/lib/openzeppelin-contracts"]
88
path = contracts/evm/lib/openzeppelin-contracts
9-
url = https://github.com/Openzeppelin/openzeppelin-contracts
9+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
1010
[submodule "contracts/evm/lib/openzeppelin-foundry-upgrades"]
1111
path = contracts/evm/lib/openzeppelin-foundry-upgrades
1212
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
@@ -16,3 +16,9 @@
1616
[submodule "contracts/evm/lib/solidity-examples"]
1717
path = contracts/evm/lib/solidity-examples
1818
url = https://github.com/LayerZero-Labs/solidity-examples
19+
[submodule "contracts/evm/lib/openzeppelin-contracts"]
20+
path = contracts/evm/lib/openzeppelin-contracts
21+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
22+
[submodule "contracts/evm/lib/openzeppelin-contracts-upgradeable"]
23+
path = contracts/evm/lib/openzeppelin-contracts-upgradeable
24+
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ members = [
88
[workspace.package]
99
authors = ["Icon Foundation<foo@icon.foundation>"]
1010
repository = "https://github.com/icon-project/ibc-integration.git"
11-
version="0.2.0"
11+
version="0.2.1"
1212

1313
[workspace.dependencies]
14-
cosmwasm-std = {version="1.2.2",default-features = false,features = ["iterator", "staking"]}
14+
cosmwasm-std = {version="1.5.5",default-features = false,features = ["iterator", "staking"]}
1515
cw-storage-plus = {git="https://github.com/icon-project/cw-storage-plus.git", branch="fix-raw"}
1616
cosmwasm-storage = "1.2.2"
1717
cosmwasm-schema = "1.2.2"

contracts/cosmwasm-vm/cw-centralized-connection/src/contract.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ impl<'a> CwCentralizedConnection<'a> {
4343
self.ensure_xcall(deps.storage, info.sender)?;
4444

4545
let next_conn_sn = self.get_next_conn_sn(deps.storage)?;
46-
self.store_conn_sn(deps.storage, next_conn_sn)?;
4746

4847
let mut fee = 0;
4948

contracts/cosmwasm-vm/cw-centralized-connection/src/helper.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<'a> CwCentralizedConnection<'a> {
5858
};
5959
let call_message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
6060
contract_addr: xcall_host.to_string(),
61-
msg: to_binary(&xcall_msg).unwrap(),
61+
msg: to_json_binary(&xcall_msg).unwrap(),
6262
funds: vec![],
6363
});
6464
let sub_msg: SubMsg = SubMsg::reply_always(call_message, XCALL_HANDLE_MESSAGE_REPLY_ID);
@@ -76,7 +76,7 @@ impl<'a> CwCentralizedConnection<'a> {
7676
};
7777
let call_message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
7878
contract_addr: xcall_host.to_string(),
79-
msg: to_binary(&xcall_msg).unwrap(),
79+
msg: to_json_binary(&xcall_msg).unwrap(),
8080
funds: vec![],
8181
});
8282
let sub_msg: SubMsg = SubMsg::reply_always(call_message, XCALL_HANDLE_ERROR_REPLY_ID);

contracts/cosmwasm-vm/cw-centralized-connection/src/lib.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ pub mod types;
77

88
use cosmwasm_schema::cw_serde;
99
use cosmwasm_std::{
10-
entry_point, to_binary, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, MessageInfo, Reply,
10+
entry_point, to_json_binary, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, MessageInfo, Reply,
1111
Response, StdError, StdResult, Storage, SubMsg, WasmMsg,
1212
};
1313

14-
pub use contract::*;
1514
use cw2::set_contract_version;
1615
use cw_storage_plus::{Item, Map};
1716
pub use errors::*;
@@ -65,7 +64,7 @@ pub fn execute(
6564
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
6665
let centralized_connection = CwCentralizedConnection::default();
6766
match msg {
68-
QueryMsg::GetFee { nid, response } => to_binary(
67+
QueryMsg::GetFee { nid, response } => to_json_binary(
6968
&centralized_connection
7069
.get_fee(deps.storage, nid, response)
7170
.unwrap(),
@@ -74,10 +73,12 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
7473
QueryMsg::GetReceipt {
7574
src_network,
7675
conn_sn,
77-
} => to_binary(&centralized_connection.get_receipt(deps.storage, src_network, conn_sn)),
76+
} => {
77+
to_json_binary(&centralized_connection.get_receipt(deps.storage, src_network, conn_sn))
78+
}
7879

7980
QueryMsg::Admin {} => {
80-
to_binary(&centralized_connection.admin().load(deps.storage).unwrap())
81+
to_json_binary(&centralized_connection.admin().load(deps.storage).unwrap())
8182
}
8283
}
8384
}

contracts/cosmwasm-vm/cw-integration/tests/test_xcall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn test_rollback_reply() {
360360
}
361361

362362
fn test_call_message(
363-
mut ctx: &mut TestContext,
363+
ctx: &mut TestContext,
364364
data: Vec<u8>,
365365
msg_type: MessageType,
366366
) -> Result<AppResponse, AppError> {

contracts/cosmwasm-vm/cw-mock-dapp-multi/src/contract.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a> CwMockService<'a> {
6464
};
6565
let message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
6666
contract_addr: address,
67-
msg: to_binary(&msg).unwrap(),
67+
msg: to_json_binary(&msg).unwrap(),
6868
funds: info.funds,
6969
});
7070
let submessage = SubMsg {
@@ -123,7 +123,7 @@ impl<'a> CwMockService<'a> {
123123
let msg = ExecuteMsg::SendCall { envelope, to };
124124
let message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
125125
contract_addr: address,
126-
msg: to_binary(&msg).unwrap(),
126+
msg: to_json_binary(&msg).unwrap(),
127127
funds: info.funds,
128128
});
129129

@@ -154,7 +154,7 @@ impl<'a> CwMockService<'a> {
154154
let msg = ExecuteMsg::SendCall { to, envelope };
155155
let message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
156156
contract_addr: address,
157-
msg: to_binary(&msg).unwrap(),
157+
msg: to_json_binary(&msg).unwrap(),
158158
funds: info.funds,
159159
});
160160

contracts/cosmwasm-vm/cw-mock-dapp-multi/src/lib.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ pub mod types;
77

88
use cosmwasm_schema::cw_serde;
99
use cosmwasm_std::{
10-
entry_point, to_binary, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, MessageInfo, Response,
11-
StdError, StdResult, Storage, WasmMsg,
10+
entry_point, to_json_binary, Binary, CosmosMsg, Deps, DepsMut, Empty, Env, MessageInfo,
11+
Response, StdError, StdResult, Storage, WasmMsg,
1212
};
1313

14-
pub use contract::*;
1514
use cw2::set_contract_version;
1615
use cw_storage_plus::{Item, Map};
1716
pub use errors::*;
18-
pub use helper::*;
1917
use msg::{ExecuteMsg, QueryMsg};
2018
use state::{Connection, CwMockService};
2119
use thiserror::Error;
22-
use types::InstantiateMsg;
2320
pub use types::*;
2421

2522
#[entry_point]
@@ -85,6 +82,8 @@ pub fn execute(
8582
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
8683
let call_service = CwMockService::default();
8784
match msg {
88-
QueryMsg::GetSequence {} => to_binary(&call_service.get_sequence(deps.storage).unwrap()),
85+
QueryMsg::GetSequence {} => {
86+
to_json_binary(&call_service.get_sequence(deps.storage).unwrap())
87+
}
8988
}
9089
}

contracts/cosmwasm-vm/cw-mock-dapp/src/contract.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a> CwMockService<'a> {
5151
};
5252
let message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
5353
contract_addr: address,
54-
msg: to_binary(&msg).unwrap(),
54+
msg: to_json_binary(&msg).unwrap(),
5555
funds: info.funds,
5656
});
5757

@@ -89,7 +89,7 @@ impl<'a> CwMockService<'a> {
8989
let msg = ExecuteMsg::SendCall { envelope, to };
9090
let message: CosmosMsg<Empty> = CosmosMsg::Wasm(WasmMsg::Execute {
9191
contract_addr: address,
92-
msg: to_binary(&msg).unwrap(),
92+
msg: to_json_binary(&msg).unwrap(),
9393
funds: info.funds,
9494
});
9595

0 commit comments

Comments
 (0)