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 authored and outofxxx committed Jan 11, 2024
1 parent 8a52746 commit 4150fa1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions primitives/core/src/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

use crate::{
AccountId, BnbDigitDomainType, BoundedWeb3Network, EVMTokenType, GenericDiscordRoleType,
OneBlockCourseType, VIP3MembershipCardLevel, Web3Network,
OneBlockCourseType, VIP3MembershipCardLevel, Web3Network, all_web3networks,
};
use codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
Expand Down Expand Up @@ -263,14 +263,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::A1 |
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

0 comments on commit 4150fa1

Please sign in to comment.