@@ -77,7 +77,7 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
77
77
type_url: Self :: TYPE_URL . to_string( ) ,
78
78
value: self . to_proto_bytes( ) ,
79
79
}
80
- }
80
+ }
81
81
}
82
82
83
83
#query_request_conversion
@@ -102,20 +102,16 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
102
102
103
103
fn try_from( binary: cosmwasm_std:: Binary ) -> Result <Self , Self :: Error > {
104
104
use :: prost:: Message ;
105
- #[ cfg( feature = "backtraces" ) ]
106
- use std:: backtrace:: Backtrace ;
107
105
Self :: decode( & binary[ ..] ) . map_err( |e| {
108
- cosmwasm_std:: StdError :: ParseErr {
109
- target_type : stringify!( #ident) . to_string ( ) ,
110
- msg : format!(
106
+ cosmwasm_std:: StdError :: parse_err (
107
+ stringify!( #ident) ,
108
+ format!(
111
109
"Unable to decode binary: \n - base64: {}\n - bytes array: {:?}\n \n {:?}" ,
112
110
binary,
113
111
binary. to_vec( ) ,
114
112
e
115
- ) ,
116
- #[ cfg( feature = "backtraces" ) ]
117
- backtrace: Backtrace :: capture( ) ,
118
- }
113
+ )
114
+ )
119
115
} )
120
116
}
121
117
}
@@ -124,21 +120,11 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream {
124
120
type Error = cosmwasm_std:: StdError ;
125
121
126
122
fn try_from( result: cosmwasm_std:: SubMsgResult ) -> Result <Self , Self :: Error > {
127
- #[ cfg( feature = "backtraces" ) ]
128
- use std:: backtrace:: Backtrace ;
129
123
result
130
124
. into_result( )
131
- . map_err( |e| cosmwasm_std:: StdError :: GenericErr {
132
- msg: e,
133
- #[ cfg( feature = "backtraces" ) ]
134
- backtrace: Backtrace :: capture( ) ,
135
- } ) ?
125
+ . map_err( |e| cosmwasm_std:: StdError :: generic_err( e) ) ?
136
126
. data
137
- . ok_or_else( || cosmwasm_std:: StdError :: NotFound {
138
- kind: "cosmwasm_std::SubMsgResult::<T>" . to_string( ) ,
139
- #[ cfg( feature = "backtraces" ) ]
140
- backtrace: Backtrace :: capture( ) ,
141
- } ) ?
127
+ . ok_or_else( || cosmwasm_std:: StdError :: not_found( "cosmwasm_std::SubMsgResult::<T>" ) ) ?
142
128
. try_into( )
143
129
}
144
130
}
0 commit comments