File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ impl Adapter for EthereumAdapter {
145
145
) ) ;
146
146
}
147
147
148
- let contract_address = Address :: from_slice ( & self . config . ethereum_core_address ) ;
148
+ let contract_address: Address = self . config . ethereum_core_address . into ( ) ;
149
149
150
150
let ( _eloop, transport) = web3:: transports:: Http :: new ( & self . config . ethereum_network )
151
151
. map_err ( |_| map_error ( "failed to init http transport" ) ) ?;
@@ -209,7 +209,7 @@ impl Adapter for EthereumAdapter {
209
209
210
210
let sess = match & verified. payload . identity {
211
211
Some ( identity) => {
212
- let contract_address = Address :: from_slice ( identity) ;
212
+ let contract_address: Address = identity. into ( ) ;
213
213
let ( _eloop, transport) =
214
214
web3:: transports:: Http :: new ( & self . config . ethereum_network )
215
215
. map_err ( |_| map_error ( "failed to init http transport" ) ) ?;
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ impl EthereumChannel {
172
172
}
173
173
174
174
pub fn hash_hex ( & self , contract_addr : & [ u8 ; 20 ] ) -> Result < String , Box < dyn Error > > {
175
- let result = self . hash ( & contract_addr) ?;
175
+ let result = self . hash ( contract_addr) ?;
176
176
Ok ( format ! ( "0x{}" , hex:: encode( result) ) )
177
177
}
178
178
Original file line number Diff line number Diff line change @@ -32,18 +32,18 @@ impl ValidatorId {
32
32
}
33
33
}
34
34
35
- impl AsRef < [ u8 ] > for ValidatorId {
36
- fn as_ref ( & self ) -> & [ u8 ] {
37
- & self . 0
38
- }
39
- }
40
-
41
35
impl From < & [ u8 ; 20 ] > for ValidatorId {
42
36
fn from ( bytes : & [ u8 ; 20 ] ) -> Self {
43
37
Self ( * bytes)
44
38
}
45
39
}
46
40
41
+ impl AsRef < [ u8 ] > for ValidatorId {
42
+ fn as_ref ( & self ) -> & [ u8 ] {
43
+ & self . 0
44
+ }
45
+ }
46
+
47
47
impl TryFrom < & str > for ValidatorId {
48
48
type Error = DomainError ;
49
49
fn try_from ( value : & str ) -> Result < Self , Self :: Error > {
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ impl<T: Adapter + 'static> SentryApi<T> {
36
36
let client = Client :: builder ( )
37
37
. timeout ( Duration :: from_secs ( config. fetch_timeout . into ( ) ) )
38
38
. build ( )
39
- . unwrap ( ) ;
39
+ . map_err ( |e| ValidatorWorker :: Failed ( format ! ( "building Client error: {}" , e ) ) ) ? ;
40
40
41
41
// validate that we are to validate the channel
42
42
match channel. spec . validators . find ( adapter. whoami ( ) ) {
You can’t perform that action at this time.
0 commit comments