@@ -72,6 +72,7 @@ pub mod pallet {
72
72
RelayerRemoved { who : Identity } ,
73
73
BtcWalletGenerated { pub_key : PubKey , account_id : T :: AccountId } ,
74
74
EthWalletGenerated { pub_key : PubKey } ,
75
+ VaultRemoved { who : T :: AccountId } ,
75
76
}
76
77
77
78
#[ pallet:: error]
@@ -81,6 +82,7 @@ pub mod pallet {
81
82
UnsupportedRelayerType ,
82
83
BtcWalletAlreadyExist ,
83
84
EthWalletAlreadyExist ,
85
+ VaultNotExist ,
84
86
}
85
87
86
88
#[ pallet:: genesis_config]
@@ -123,23 +125,39 @@ pub mod pallet {
123
125
124
126
#[ pallet:: call_index( 1 ) ]
125
127
#[ pallet:: weight( { 195_000_000 } ) ]
126
- pub fn add_relayer ( origin : OriginFor < T > , account : Identity ) -> DispatchResult {
128
+ pub fn add_relayer ( origin : OriginFor < T > , account : Identity ) -> DispatchResultWithPostInfo {
127
129
Self :: ensure_admin_or_root ( origin) ?;
128
130
ensure ! ( account. is_substrate( ) || account. is_evm( ) , Error :: <T >:: UnsupportedRelayerType ) ;
129
131
// we don't care if `account` already exists
130
132
Relayer :: < T > :: insert ( account. clone ( ) , ( ) ) ;
131
133
Self :: deposit_event ( Event :: RelayerAdded { who : account } ) ;
132
- Ok ( ( ) )
134
+ Ok ( Pays :: No . into ( ) )
133
135
}
134
136
135
137
#[ pallet:: call_index( 2 ) ]
136
138
#[ pallet:: weight( { 195_000_000 } ) ]
137
- pub fn remove_relayer ( origin : OriginFor < T > , account : Identity ) -> DispatchResult {
139
+ pub fn remove_relayer (
140
+ origin : OriginFor < T > ,
141
+ account : Identity ,
142
+ ) -> DispatchResultWithPostInfo {
138
143
Self :: ensure_admin_or_root ( origin) ?;
139
144
ensure ! ( Relayer :: <T >:: contains_key( & account) , Error :: <T >:: RelayerNotExist ) ;
140
145
Relayer :: < T > :: remove ( account. clone ( ) ) ;
141
146
Self :: deposit_event ( Event :: RelayerRemoved { who : account } ) ;
142
- Ok ( ( ) )
147
+ Ok ( Pays :: No . into ( ) )
148
+ }
149
+
150
+ #[ pallet:: call_index( 3 ) ]
151
+ #[ pallet:: weight( { 195_000_000 } ) ]
152
+ pub fn remove_vault (
153
+ origin : OriginFor < T > ,
154
+ account : T :: AccountId ,
155
+ ) -> DispatchResultWithPostInfo {
156
+ Self :: ensure_admin_or_root ( origin) ?;
157
+ ensure ! ( Vault :: <T >:: contains_key( & account) , Error :: <T >:: VaultNotExist ) ;
158
+ Vault :: < T > :: remove ( account. clone ( ) ) ;
159
+ Self :: deposit_event ( Event :: VaultRemoved { who : account } ) ;
160
+ Ok ( Pays :: No . into ( ) )
143
161
}
144
162
145
163
/// ---------------------------------------------------
0 commit comments