@@ -8,8 +8,8 @@ use crate::Bytes;
8
8
9
9
#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
10
10
#[ cfg_attr(
11
- feature = "with-codec " ,
12
- derive( codec :: Encode , codec :: Decode , scale_info:: TypeInfo )
11
+ feature = "with-scale " ,
12
+ derive( scale_codec :: Encode , scale_codec :: Decode , scale_info:: TypeInfo )
13
13
) ]
14
14
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
15
15
pub enum TransactionAction {
@@ -44,8 +44,8 @@ impl rlp::Decodable for TransactionAction {
44
44
45
45
#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
46
46
#[ cfg_attr(
47
- feature = "with-codec " ,
48
- derive( codec :: Encode , codec :: Decode , scale_info:: TypeInfo )
47
+ feature = "with-scale " ,
48
+ derive( scale_codec :: Encode , scale_codec :: Decode , scale_info:: TypeInfo )
49
49
) ]
50
50
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
51
51
pub struct TransactionRecoveryId ( pub u64 ) ;
@@ -77,7 +77,7 @@ impl TransactionRecoveryId {
77
77
}
78
78
79
79
#[ derive( Clone , Debug , PartialEq , Eq ) ]
80
- #[ cfg_attr( feature = "with-codec " , derive( scale_info:: TypeInfo ) ) ]
80
+ #[ cfg_attr( feature = "with-scale " , derive( scale_info:: TypeInfo ) ) ]
81
81
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
82
82
pub struct TransactionSignature {
83
83
v : TransactionRecoveryId ,
@@ -146,32 +146,32 @@ impl TransactionSignature {
146
146
}
147
147
}
148
148
149
- #[ cfg( feature = "codec " ) ]
150
- impl codec :: Encode for TransactionSignature {
149
+ #[ cfg( feature = "with-scale " ) ]
150
+ impl scale_codec :: Encode for TransactionSignature {
151
151
fn size_hint ( & self ) -> usize {
152
- codec :: Encode :: size_hint ( & ( self . v . 0 , self . r , self . s ) )
152
+ scale_codec :: Encode :: size_hint ( & ( self . v . 0 , self . r , self . s ) )
153
153
}
154
154
155
155
fn using_encoded < R , F : FnOnce ( & [ u8 ] ) -> R > ( & self , f : F ) -> R {
156
- codec :: Encode :: using_encoded ( & ( self . v . 0 , self . r , self . s ) , f)
156
+ scale_codec :: Encode :: using_encoded ( & ( self . v . 0 , self . r , self . s ) , f)
157
157
}
158
158
}
159
159
160
- #[ cfg( feature = "codec " ) ]
161
- impl codec :: Decode for TransactionSignature {
162
- fn decode < I : codec :: Input > ( value : & mut I ) -> Result < Self , codec :: Error > {
163
- let ( v, r, s) = codec :: Decode :: decode ( value) ?;
160
+ #[ cfg( feature = "with-scale " ) ]
161
+ impl scale_codec :: Decode for TransactionSignature {
162
+ fn decode < I : scale_codec :: Input > ( value : & mut I ) -> Result < Self , scale_codec :: Error > {
163
+ let ( v, r, s) = scale_codec :: Decode :: decode ( value) ?;
164
164
match Self :: new ( v, r, s) {
165
165
Some ( signature) => Ok ( signature) ,
166
- None => Err ( codec :: Error :: from ( "Invalid signature" ) ) ,
166
+ None => Err ( scale_codec :: Error :: from ( "Invalid signature" ) ) ,
167
167
}
168
168
}
169
169
}
170
170
171
171
#[ derive( Clone , Debug , PartialEq , Eq ) ]
172
172
#[ cfg_attr(
173
- feature = "with-codec " ,
174
- derive( codec :: Encode , codec :: Decode , scale_info:: TypeInfo )
173
+ feature = "with-scale " ,
174
+ derive( scale_codec :: Encode , scale_codec :: Decode , scale_info:: TypeInfo )
175
175
) ]
176
176
#[ cfg_attr( feature = "with-serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
177
177
pub struct LegacyTransaction {
@@ -250,10 +250,6 @@ impl rlp::Decodable for LegacyTransaction {
250
250
}
251
251
252
252
#[ derive( Clone , Debug , PartialEq , Eq ) ]
253
- #[ cfg_attr(
254
- feature = "with-codec" ,
255
- derive( codec:: Encode , codec:: Decode , scale_info:: TypeInfo )
256
- ) ]
257
253
pub struct LegacyTransactionMessage {
258
254
pub nonce : U256 ,
259
255
pub gas_price : U256 ,
0 commit comments