Skip to content

Commit

Permalink
fix: patch valid source check (#339)
Browse files Browse the repository at this point in the history
* fix: patch valid source check

* fix: fix ci pipeline

* fix: fix ci pipeline

* fix: fix ci pipeline

* fix: version fix on submodule

* fix: Update openzeppelin-contracts-upgradeable to specific commit

* fix: Update openzeppelin-contracts-upgradeable to specific commit

---------

Co-authored-by: ibrizsabin <[email protected]>
  • Loading branch information
gcranju and ibrizsabin authored Jul 22, 2024
1 parent 98dd4b1 commit a883375
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/basic-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

- name: Install Rust
run: rustup update stable

- name: Lock Rust Version
run: rustup override set nightly-2023-03-27

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -53,13 +56,21 @@ jobs:

- name: Install Rust
run: rustup update stable

- name: Lock Rust Version
run: rustup override set nightly-2023-03-27

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2

- name: Install cargo-fmt
run: rustup component add --toolchain nightly-2023-03-27-x86_64-unknown-linux-gnu rustfmt

- name: Run cargo fmt
run: |
cargo fmt --all -- --check
- name: Install cargo-fmt
run: rustup component add --toolchain nightly-2023-03-27-x86_64-unknown-linux-gnu clippy

- name: Run cargo clippy
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cosmwasm-contracts-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
submodules: true
- name: Install Rust
run: rustup update stable
- name: Lock Rust Version
run: rustup override set nightly-2023-03-27
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
[submodule "contracts/evm/xcall/lib/openzeppelin-contracts"]
path = contracts/evm/lib/openzeppelin-contracts
url = https://github.com/Openzeppelin/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/evm/lib/openzeppelin-foundry-upgrades"]
path = contracts/evm/lib/openzeppelin-foundry-upgrades
url = https://github.com/OpenZeppelin/openzeppelin-foundry-upgrades
Expand Down
8 changes: 6 additions & 2 deletions contracts/cosmwasm-vm/cw-xcall/src/handle_call_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,12 @@ impl<'a> CwCallService<'a> {
if protocols.contains(source) {
return Ok(true);
}
let default_conn = self.get_default_connection(store, src_net)?;
Ok(source.clone() == default_conn)
if protocols.len() == 0 {
let default_conn = self.get_default_connection(store, src_net)?;
Ok(source.clone() == default_conn)
} else {
Ok(false)
}
}

pub fn handle_error(
Expand Down
2 changes: 1 addition & 1 deletion contracts/cosmwasm-vm/cw-xcall/src/types/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl CSMessageRequest {
}

pub fn as_bytes(&self) -> Vec<u8> {
rlp::encode(self.clone()).to_vec()
rlp::encode(self).to_vec()
}
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/evm/lib/openzeppelin-contracts-upgradeable

0 comments on commit a883375

Please sign in to comment.