@@ -24,7 +24,6 @@ use std::fmt::{Display, Formatter, Result as FormatResult};
2424#[ derive( Debug , PartialEq , Clone , Eq , Serialize ) ]
2525#[ serde( tag = "type" , content = "content" ) ]
2626pub enum Error {
27- FailedToHandleCustomAction ( String ) ,
2827 /// Sender doesn't have enough funds to pay for this Transaction
2928 InsufficientBalance {
3029 address : Address ,
@@ -35,18 +34,19 @@ pub enum Error {
3534 } ,
3635 InsufficientPermission ,
3736 /// Returned when transaction seq does not match state seq
38- InvalidSeq ( Mismatch < u64 > ) ,
3937 InvalidShardId ( ShardId ) ,
4038 InvalidTransferDestination ,
4139 NewOwnersMustContainSender ,
4240 RegularKeyAlreadyInUse ,
4341 RegularKeyAlreadyInUseAsPlatformAccount ,
4442 /// Tried to use master key even register key is registered
4543 CannotUseMasterKey ,
44+ InvalidSeq ( Mismatch < u64 > ) ,
4645 NonActiveAccount {
4746 address : Address ,
4847 name : String ,
4948 } ,
49+ FailedToHandleCustomAction ( String ) ,
5050 SignatureOfInvalidAccount ( Address ) ,
5151 InsufficientStakes ( Mismatch < u64 > ) ,
5252 InvalidValidatorIndex {
@@ -58,20 +58,20 @@ pub enum Error {
5858#[ derive( Clone , Copy ) ]
5959#[ repr( u8 ) ]
6060enum ErrorID {
61- InsufficientBalance = 8 ,
62- InsufficientPermission = 9 ,
63- InvalidShardID = 15 ,
64- InvalidTransferDestination = 16 ,
65- NewOwnersMustContainSender = 17 ,
66- RegularKeyAlreadyInUse = 19 ,
67- RegularKeyAlreadyInUseAsPlatform = 20 ,
68- CannotUseMasterKey = 25 ,
69- InvalidSeq = 28 ,
70- NonActiveAccount = 30 ,
71- FailedToHandleCustomAction = 31 ,
72- SignatureOfInvalid = 32 ,
73- InsufficientStakes = 33 ,
74- InvalidValidatorIndex = 34 ,
61+ InsufficientBalance = 1 ,
62+ InsufficientPermission = 2 ,
63+ InvalidShardID = 3 ,
64+ InvalidTransferDestination = 4 ,
65+ NewOwnersMustContainSender = 5 ,
66+ RegularKeyAlreadyInUse = 6 ,
67+ RegularKeyAlreadyInUseAsPlatform = 7 ,
68+ CannotUseMasterKey = 8 ,
69+ InvalidSeq = 9 ,
70+ NonActiveAccount = 10 ,
71+ FailedToHandleCustomAction = 11 ,
72+ SignatureOfInvalid = 12 ,
73+ InsufficientStakes = 13 ,
74+ InvalidValidatorIndex = 14 ,
7575}
7676
7777impl Encodable for ErrorID {
@@ -84,20 +84,20 @@ impl Decodable for ErrorID {
8484 fn decode ( rlp : & Rlp ) -> Result < Self , DecoderError > {
8585 let tag = rlp. as_val ( ) ?;
8686 match tag {
87- 8u8 => Ok ( ErrorID :: FailedToHandleCustomAction ) ,
88- 10 => Ok ( ErrorID :: InsufficientBalance ) ,
89- 11 => Ok ( ErrorID :: InsufficientPermission ) ,
90- 18 => Ok ( ErrorID :: InvalidSeq ) ,
91- 19 => Ok ( ErrorID :: InvalidShardID ) ,
92- 20 => Ok ( ErrorID :: InvalidTransferDestination ) ,
93- 21 => Ok ( ErrorID :: NewOwnersMustContainSender ) ,
94- 23 => Ok ( ErrorID :: RegularKeyAlreadyInUse ) ,
95- 24 => Ok ( ErrorID :: RegularKeyAlreadyInUseAsPlatform ) ,
96- 30 => Ok ( ErrorID :: CannotUseMasterKey ) ,
97- 31 => Ok ( ErrorID :: NonActiveAccount ) ,
98- 32 => Ok ( ErrorID :: SignatureOfInvalid ) ,
99- 33 => Ok ( ErrorID :: InsufficientStakes ) ,
100- 34 => Ok ( ErrorID :: InvalidValidatorIndex ) ,
87+ 1u8 => Ok ( ErrorID :: InsufficientBalance ) ,
88+ 2 => Ok ( ErrorID :: InsufficientPermission ) ,
89+ 3 => Ok ( ErrorID :: InvalidShardID ) ,
90+ 4 => Ok ( ErrorID :: InvalidTransferDestination ) ,
91+ 5 => Ok ( ErrorID :: NewOwnersMustContainSender ) ,
92+ 6 => Ok ( ErrorID :: RegularKeyAlreadyInUse ) ,
93+ 7 => Ok ( ErrorID :: RegularKeyAlreadyInUseAsPlatform ) ,
94+ 8 => Ok ( ErrorID :: CannotUseMasterKey ) ,
95+ 9 => Ok ( ErrorID :: InvalidSeq ) ,
96+ 10 => Ok ( ErrorID :: NonActiveAccount ) ,
97+ 11 => Ok ( ErrorID :: FailedToHandleCustomAction ) ,
98+ 12 => Ok ( ErrorID :: SignatureOfInvalid ) ,
99+ 13 => Ok ( ErrorID :: InsufficientStakes ) ,
100+ 14 => Ok ( ErrorID :: InvalidValidatorIndex ) ,
101101 _ => Err ( DecoderError :: Custom ( "Unexpected ActionTag Value" ) ) ,
102102 }
103103 }
0 commit comments