File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
algokit_transact/src/test_utils Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -553,12 +553,17 @@ fn normalise_json(value: serde_json::Value) -> serde_json::Value {
553
553
"num_uints" ,
554
554
] ;
555
555
556
+ // Boolean fields that should always be included, even when false
557
+ const BOOLEAN_FIELDS_TO_KEEP : & [ & str ] = & [ "frozen" , "default_frozen" ] ;
558
+
556
559
match value {
557
560
serde_json:: Value :: Object ( map) => serde_json:: Value :: Object (
558
561
map. into_iter ( )
559
562
. filter ( |( k, v) | {
560
563
!( v. is_null ( )
561
- || v. is_boolean ( ) && v. as_bool ( ) == Some ( false )
564
+ || v. is_boolean ( )
565
+ && v. as_bool ( ) == Some ( false )
566
+ && !BOOLEAN_FIELDS_TO_KEEP . contains ( & k. to_case ( Case :: Snake ) . as_str ( ) )
562
567
|| v. is_number ( )
563
568
&& v. as_u64 ( ) == Some ( 0 )
564
569
&& !ZERO_VALUE_EXCLUDED_FIELDS
Original file line number Diff line number Diff line change @@ -243,15 +243,18 @@ impl TryFrom<Transaction> for algokit_transact::Transaction {
243
243
TransactionType :: AssetTransfer => {
244
244
Ok ( algokit_transact:: Transaction :: AssetTransfer ( tx. try_into ( ) ?) )
245
245
}
246
+
246
247
TransactionType :: AssetConfig => {
247
248
Ok ( algokit_transact:: Transaction :: AssetConfig ( tx. try_into ( ) ?) )
248
249
}
250
+
249
251
TransactionType :: ApplicationCall => Ok ( algokit_transact:: Transaction :: ApplicationCall (
250
252
tx. try_into ( ) ?,
251
253
) ) ,
252
254
TransactionType :: AssetFreeze => {
253
255
Ok ( algokit_transact:: Transaction :: AssetFreeze ( tx. try_into ( ) ?) )
254
256
}
257
+
255
258
_ => Err ( Self :: Error :: DecodingError (
256
259
"Transaction type is not implemented" . to_string ( ) ,
257
260
) ) ,
Original file line number Diff line number Diff line change 38780
38780
94
38781
38781
]
38782
38782
},
38783
+ "defaultFrozen": false,
38783
38784
"freeze": {
38784
38785
"address": "KPVZ66IFE7KHQ6623XHTPVS3IL7BXBE3HXQG35J65CVDA54VLRPP4SVOU4",
38785
38786
"pubKey": [
46845
46846
201,
46846
46847
123
46847
46848
]
46848
- }
46849
+ },
46850
+ "frozen": false
46849
46851
},
46850
46852
"fee": 1000,
46851
46853
"firstValid": 50659540,
You can’t perform that action at this time.
0 commit comments