@@ -229,10 +229,9 @@ impl Actor {
229
229
230
230
let ( _, tx) = ptx
231
231
. delete ( & params. id . key ( ) )
232
- . context_code (
233
- ExitCode :: USR_ILLEGAL_STATE ,
234
- format ! ( "failed to pop transaction {:?} for cancel" , params. id) ,
235
- ) ?
232
+ . with_context_code ( ExitCode :: USR_ILLEGAL_STATE , || {
233
+ format ! ( "failed to pop transaction {:?} for cancel" , params. id)
234
+ } ) ?
236
235
. ok_or_else ( || {
237
236
actor_error ! ( not_found, "no such transaction {:?} to cancel" , params. id)
238
237
} ) ?;
@@ -242,10 +241,10 @@ impl Actor {
242
241
return Err ( actor_error ! ( forbidden; "Cannot cancel another signers transaction" ) ) ;
243
242
}
244
243
245
- let calculated_hash = compute_proposal_hash ( & tx, rt) . context_code (
246
- ExitCode :: USR_ILLEGAL_STATE ,
247
- format ! ( "failed to compute proposal hash for (tx: {:?})" , params. id) ,
248
- ) ?;
244
+ let calculated_hash = compute_proposal_hash ( & tx, rt)
245
+ . with_context_code ( ExitCode :: USR_ILLEGAL_STATE , || {
246
+ format ! ( "failed to compute proposal hash for (tx: {:?})" , params. id)
247
+ } ) ?;
249
248
250
249
if !params. proposal_hash . is_empty ( ) && params. proposal_hash != calculated_hash {
251
250
return Err ( actor_error ! ( illegal_state, "hash does not match proposal params" ) ) ;
@@ -456,10 +455,10 @@ impl Actor {
456
455
// update approved on the transaction
457
456
txn. approved . push ( rt. message ( ) . caller ( ) ) ;
458
457
459
- ptx. set ( tx_id. key ( ) , txn. clone ( ) ) . context_code (
460
- ExitCode :: USR_ILLEGAL_STATE ,
461
- format ! ( "failed to put transaction {} for approval" , tx_id. 0 ) ,
462
- ) ?;
458
+ ptx. set ( tx_id. key ( ) , txn. clone ( ) )
459
+ . with_context_code ( ExitCode :: USR_ILLEGAL_STATE , || {
460
+ format ! ( "failed to put transaction {} for approval" , tx_id. 0 )
461
+ } ) ?;
463
462
464
463
st. pending_txs = ptx. flush ( ) . context_code (
465
464
ExitCode :: USR_ILLEGAL_STATE ,
0 commit comments