Skip to content

Commit

Permalink
Proxy EthereumBridge (#526)
Browse files Browse the repository at this point in the history
* Add new proxy type 'Relaying'

* rename: to `EthereumBridge`

* update: types

* add: missing module

* fix: compile

* update: types

* fix: compile

Co-authored-by: Xavier Lau <c.estlavie@icloud.com>
  • Loading branch information
wuminzhe and aurexav authored Sep 12, 2020
1 parent 93dffe6 commit f4c079d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
11 changes: 11 additions & 0 deletions runtime/crab/darwinia_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@
"bonded_proposal": "Vec<(Balance, TcHeaderThing)>",
"extend_from_header_hash": "Option<TcHeaderHash>"
},
"__[crab.runtime]__": {
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
}
},
"__[node.rpc]__": {},
"BalancesRuntimeDispatchInfo": {
"usable_balance": "Balance"
Expand Down
11 changes: 11 additions & 0 deletions runtime/crab/polkadot_compatible_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@
"bonded_proposal": "Vec<(Balance, TcHeaderThing)>",
"extend_from_header_hash": "Option<TcHeaderHash>"
},
"__[crab.runtime]__": {
"ProxyType": {
"_enum": {
"Any": null,
"NonTransfer": null,
"Staking": null,
"IdentityJudgement": null,
"EthereumBridge": null
}
}
},
"__[node.rpc]__": {},
"BalancesRuntimeDispatchInfo": {
"usable_balance": "Balance"
Expand Down
7 changes: 6 additions & 1 deletion runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ pub enum ProxyType {
NonTransfer,
Staking,
IdentityJudgement,
EthereumBridge,
}
impl Default for ProxyType {
fn default() -> Self {
Expand Down Expand Up @@ -676,14 +677,18 @@ impl InstanceFilter<Call> for ProxyType {
Call::EthereumBacking(..) |
Call::EthereumRelay(..) |
Call::EthereumRelayerGame(..) |
Call::HeaderMMR(..)
Call::HeaderMMR(..) |
Call::CrabIssuing(..)
),
ProxyType::Staking => matches!(c, Call::Staking(..) | Call::Utility(..)),
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement(..))
| Call::Utility(pallet_utility::Call::batch(..))
),
ProxyType::EthereumBridge => {
matches!(c, Call::EthereumBacking(..) | Call::EthereumRelay(..))
}
}
}
fn is_superset(&self, o: &Self) -> bool {
Expand Down

0 comments on commit f4c079d

Please sign in to comment.