Skip to content

Commit c668b4c

Browse files
committed
fix: unstake body fee
1 parent 16328a4 commit c668b4c

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: lib/src/schema/unstake_body.dart

+13-6
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,19 @@ class UnstakeBody extends GeneratedMessage {
6868
asHex: asHex,
6969
));
7070

71-
Map<String, dynamic> jsonMap({bool asHex = false}) => {
72-
"operator": operator.address,
73-
"withdrawal": withdrawal.jsonMap(asHex: asHex),
74-
"fee": fee.toInt(),
75-
"nonce": nonce.toInt(),
76-
};
71+
Map<String, dynamic> jsonMap({bool asHex = false}) {
72+
Map<String, dynamic> data = {
73+
"operator": operator.address,
74+
"withdrawal": withdrawal.jsonMap(asHex: asHex),
75+
"nonce": nonce.toInt(),
76+
};
77+
78+
if (fee > 0) {
79+
data['fee'] = fee.toInt();
80+
}
81+
82+
return data;
83+
}
7784

7885
Uint8List get pbBytes => writeToBuffer();
7986

0 commit comments

Comments
 (0)