@@ -23,14 +23,14 @@ use snafu::Snafu;
2323#[ derive( Debug , Snafu ) ]
2424#[ cfg_attr( feature = "ffi_uniffi" , derive( uniffi:: Error ) ) ]
2525pub enum AlgoKitTransactError {
26- #[ snafu( display( "EncodingError: {message }" ) ) ]
27- EncodingError { message : String } ,
28- #[ snafu( display( "DecodingError: {message }" ) ) ]
29- DecodingError { message : String } ,
30- #[ snafu( display( "{message }" ) ) ]
31- InputError { message : String } ,
32- #[ snafu( display( "MsgPackError: {message }" ) ) ]
33- MsgPackError { message : String } ,
26+ #[ snafu( display( "EncodingError: {error_msg }" ) ) ]
27+ EncodingError { error_msg : String } ,
28+ #[ snafu( display( "DecodingError: {error_msg }" ) ) ]
29+ DecodingError { error_msg : String } ,
30+ #[ snafu( display( "{error_msg }" ) ) ]
31+ InputError { error_msg : String } ,
32+ #[ snafu( display( "MsgPackError: {error_msg }" ) ) ]
33+ MsgPackError { error_msg : String } ,
3434}
3535
3636// Convert errors from the Rust crate into the FFI-specific errors
@@ -39,40 +39,40 @@ impl From<algokit_transact::AlgoKitTransactError> for AlgoKitTransactError {
3939 match e {
4040 algokit_transact:: AlgoKitTransactError :: DecodingError { .. } => {
4141 AlgoKitTransactError :: DecodingError {
42- message : e. to_string ( ) ,
42+ error_msg : e. to_string ( ) ,
4343 }
4444 }
4545 algokit_transact:: AlgoKitTransactError :: EncodingError { .. } => {
4646 AlgoKitTransactError :: EncodingError {
47- message : e. to_string ( ) ,
47+ error_msg : e. to_string ( ) ,
4848 }
4949 }
5050 algokit_transact:: AlgoKitTransactError :: MsgpackDecodingError { .. } => {
5151 AlgoKitTransactError :: DecodingError {
52- message : e. to_string ( ) ,
52+ error_msg : e. to_string ( ) ,
5353 }
5454 }
5555 algokit_transact:: AlgoKitTransactError :: MsgpackEncodingError { .. } => {
5656 AlgoKitTransactError :: EncodingError {
57- message : e. to_string ( ) ,
57+ error_msg : e. to_string ( ) ,
5858 }
5959 }
6060 algokit_transact:: AlgoKitTransactError :: UnknownTransactionType { .. } => {
6161 AlgoKitTransactError :: DecodingError {
62- message : e. to_string ( ) ,
62+ error_msg : e. to_string ( ) ,
6363 }
6464 }
65- algokit_transact:: AlgoKitTransactError :: InputError { message } => {
66- AlgoKitTransactError :: InputError { message }
65+ algokit_transact:: AlgoKitTransactError :: InputError { err_msg : message } => {
66+ AlgoKitTransactError :: InputError { error_msg : message }
6767 }
6868 algokit_transact:: AlgoKitTransactError :: InvalidAddress { .. } => {
6969 AlgoKitTransactError :: DecodingError {
70- message : e. to_string ( ) ,
70+ error_msg : e. to_string ( ) ,
7171 }
7272 }
7373 algokit_transact:: AlgoKitTransactError :: InvalidMultisigSignature { .. } => {
7474 AlgoKitTransactError :: DecodingError {
75- message : e. to_string ( ) ,
75+ error_msg : e. to_string ( ) ,
7676 }
7777 }
7878 }
@@ -118,7 +118,7 @@ impl TryFrom<KeyPairAccount> for algokit_transact::KeyPairAccount {
118118 let pub_key: [ u8 ; ALGORAND_PUBLIC_KEY_BYTE_LENGTH ] =
119119 vec_to_array ( & value. pub_key , "public key" ) . map_err ( |e| {
120120 AlgoKitTransactError :: DecodingError {
121- message : format ! ( "Error while decoding a public key: {}" , e) ,
121+ error_msg : format ! ( "Error while decoding a public key: {}" , e) ,
122122 }
123123 } ) ?;
124124
@@ -212,7 +212,7 @@ impl TryFrom<Transaction> for algokit_transact::Transaction {
212212 > 1
213213 {
214214 return Err ( Self :: Error :: DecodingError {
215- message : "Multiple transaction type specific fields set" . to_string ( ) ,
215+ error_msg : "Multiple transaction type specific fields set" . to_string ( ) ,
216216 } ) ;
217217 }
218218
@@ -393,7 +393,7 @@ impl TryFrom<SignedTransaction> for algokit_transact::SignedTransaction {
393393 . map ( |sig| vec_to_array ( & sig, "signature" ) )
394394 . transpose ( )
395395 . map_err ( |e| AlgoKitTransactError :: DecodingError {
396- message : format ! (
396+ error_msg : format ! (
397397 "Error while decoding the signature in a signed transaction: {}" ,
398398 e
399399 ) ,
@@ -417,7 +417,7 @@ fn vec_to_array<const N: usize>(
417417 buf. to_vec ( )
418418 . try_into ( )
419419 . map_err ( |_| AlgoKitTransactError :: DecodingError {
420- message : format ! (
420+ error_msg : format ! (
421421 "Expected {} {} bytes but got {} bytes" ,
422422 context,
423423 N ,
@@ -544,7 +544,7 @@ pub fn estimate_transaction_size(transaction: Transaction) -> Result<u64, AlgoKi
544544 . estimate_size ( ) ?
545545 . try_into ( )
546546 . map_err ( |_| AlgoKitTransactError :: EncodingError {
547- message : "Failed to convert size to u64" . to_string ( ) ,
547+ error_msg : "Failed to convert size to u64" . to_string ( ) ,
548548 } )
549549}
550550
@@ -553,7 +553,7 @@ pub fn address_from_public_key(public_key: &[u8]) -> Result<String, AlgoKitTrans
553553 Ok (
554554 algokit_transact:: KeyPairAccount :: from_pubkey ( public_key. try_into ( ) . map_err ( |_| {
555555 AlgoKitTransactError :: EncodingError {
556- message : format ! (
556+ error_msg : format ! (
557557 "public key should be {} bytes" ,
558558 ALGORAND_PUBLIC_KEY_BYTE_LENGTH
559559 ) ,
0 commit comments