Skip to content

Commit

Permalink
Fix empty web3network for assertions (#2396)
Browse files Browse the repository at this point in the history
* Correct supported web3networks for assertions

* Update some crates

* adjust order
  • Loading branch information
Kailai-Wang committed Jan 9, 2024
1 parent b5dc4f8 commit b2a8883
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 38 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pallets/teerex/sgx-verify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ der = { default-features = false, version = "0.6.0" }
hex = { default-features = false, version = "0.4.3", features = ["alloc"] }
ring = { version = "0.16.20", default-features = false, features = ["alloc"] }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
serde = { default-features = false, version = "1.0.193", features = ["derive"] }
serde = { default-features = false, version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
webpki = { git = "https://github.com/rustls/webpki", version = "=0.102.0-alpha.3", rev = "da923ed", package = "rustls-webpki", default-features = false, features = ["alloc", "ring"] }
x509-cert = { default-features = false, version = "0.1.0", features = ["alloc"] }
Expand Down
2 changes: 1 addition & 1 deletion precompiles/bridge-transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = '0.9.17'

[dependencies]
log = { version = "0.4", default-features = false }
num_enum = { version = "0.7.1", default-features = false }
num_enum = { version = "0.7.2", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
rustc-hex = { version = "2.0.1", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion precompiles/parachain-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = '0.9.17'

[dependencies]
log = { version = "0.4", default-features = false }
num_enum = { version = "0.7.1", default-features = false }
num_enum = { version = "0.7.2", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive", "max-encoded-len"] }
rustc-hex = { version = "2.0.1", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion precompiles/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = '0.9.17'
evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false, optional = true }
impl-trait-for-tuples = "0.2.2"
log = { version = "0.4", default-features = false }
num_enum = { version = "0.7.1", default-features = false }
num_enum = { version = "0.7.2", default-features = false }
sha3 = { version = "0.10", default-features = false }
similar-asserts = { version = "1.5.0", optional = true }

Expand Down
2 changes: 1 addition & 1 deletion precompiles/utils/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name = "tests"
path = "tests/tests.rs"

[dependencies]
num_enum = { version = "0.7.1", default-features = false }
num_enum = { version = "0.7.2", default-features = false }
proc-macro2 = { version = "1" }
quote = { version = "1" }
sha3 = { version = "0.10", default-features = false }
Expand Down
16 changes: 7 additions & 9 deletions primitives/core/src/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ impl Assertion {
// the broader `Web3Network` (see network.rs)
pub fn get_supported_web3networks(&self) -> Vec<Web3Network> {
match self {
// A1, any web3 network is allowed
Self::A1 => all_web3networks(),
// LIT holder, not including `LitentryRococo` as it's not supported by any data provider
Self::A4(..) => vec![Web3Network::Litentry, Web3Network::Litmus, Web3Network::Ethereum],
// DOT holder
Expand All @@ -299,13 +297,13 @@ impl Assertion {
vec![Web3Network::Ethereum, Web3Network::Bsc],
// BRC20 Holder
Self::BRC20AmountHolder => vec![Web3Network::BitcoinP2tr],
// we don't care about any specific web3 network
Self::A2(..) |
Self::A3(..) |
Self::A6 |
Self::A13(..) |
Self::A20 |
Self::GenericDiscordRole(..) => vec![],
//
// general rules
//
// any web3 network is allowed
Self::A1 | Self::A13(..) | Self::A20 => all_web3networks(),
// no web3 network is allowed
Self::A2(..) | Self::A3(..) | Self::A6 | Self::GenericDiscordRole(..) => vec![],
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions tee-worker/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b2a8883

Please sign in to comment.