@@ -10,33 +10,33 @@ use thiserror::Error;
1010
1111#[ derive( Clone , Debug , Eq , Error , FromPrimitive , PartialEq ) ]
1212pub enum SystemError {
13- /// 0 (0x0) - an account with the same address already exists
13+ /// 0 - an account with the same address already exists
1414 #[ error( "an account with the same address already exists" ) ]
15- AccountAlreadyInUse ,
16- /// 1 (0x1) - account does not have enough SOL to perform the operation
15+ AccountAlreadyInUse = 0x0 ,
16+ /// 1 - account does not have enough SOL to perform the operation
1717 #[ error( "account does not have enough SOL to perform the operation" ) ]
18- ResultWithNegativeLamports ,
19- /// 2 (0x2) - cannot assign account to this program id
18+ ResultWithNegativeLamports = 0x1 ,
19+ /// 2 - cannot assign account to this program id
2020 #[ error( "cannot assign account to this program id" ) ]
21- InvalidProgramId ,
22- /// 3 (0x3) - cannot allocate account data of this length
21+ InvalidProgramId = 0x2 ,
22+ /// 3 - cannot allocate account data of this length
2323 #[ error( "cannot allocate account data of this length" ) ]
24- InvalidAccountDataLength ,
25- /// 4 (0x4) - length of requested seed is too long
24+ InvalidAccountDataLength = 0x3 ,
25+ /// 4 - length of requested seed is too long
2626 #[ error( "length of requested seed is too long" ) ]
27- MaxSeedLengthExceeded ,
28- /// 5 (0x5) - provided address does not match addressed derived from seed
27+ MaxSeedLengthExceeded = 0x4 ,
28+ /// 5 - provided address does not match addressed derived from seed
2929 #[ error( "provided address does not match addressed derived from seed" ) ]
30- AddressWithSeedMismatch ,
31- /// 6 (0x6) - advancing stored nonce requires a populated RecentBlockhashes sysvar
30+ AddressWithSeedMismatch = 0x5 ,
31+ /// 6 - advancing stored nonce requires a populated RecentBlockhashes sysvar
3232 #[ error( "advancing stored nonce requires a populated RecentBlockhashes sysvar" ) ]
33- NonceNoRecentBlockhashes ,
34- /// 7 (0x7) - stored nonce is still in recent_blockhashes
33+ NonceNoRecentBlockhashes = 0x6 ,
34+ /// 7 - stored nonce is still in recent_blockhashes
3535 #[ error( "stored nonce is still in recent_blockhashes" ) ]
36- NonceBlockhashNotExpired ,
37- /// 8 (0x8) - specified nonce does not match stored nonce
36+ NonceBlockhashNotExpired = 0x7 ,
37+ /// 8 - specified nonce does not match stored nonce
3838 #[ error( "specified nonce does not match stored nonce" ) ]
39- NonceUnexpectedBlockhashValue ,
39+ NonceUnexpectedBlockhashValue = 0x8 ,
4040}
4141
4242impl solana_program:: program_error:: PrintProgramError for SystemError {
0 commit comments