Skip to content

Commit

Permalink
fix eos serialize/deserialize for bool type (#1934)
Browse files Browse the repository at this point in the history
* fix eos deserialize for bool type

* fix eos serialize for bool type
  • Loading branch information
chuck-h authored Nov 5, 2022
1 parent e47ac55 commit a638dfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/crypto/eosdart/src/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,10 @@ Map<String, Type> createInitialTypes() {
"bool": createType(
name: 'bool',
serialize: (Type self, SerialBuffer buffer, Object data, {SerializerState? state, bool? allowExtensions}) {
buffer.push([data == null ? 1 : 0]);
buffer.push([data == true ? 1 : 0]);
},
deserialize: (Type self, SerialBuffer buffer, {SerializerState? state, bool? allowExtensions}) {
return buffer.get();
return buffer.get()!=0;
},
),
"uint8": createType(
Expand Down

0 comments on commit a638dfb

Please sign in to comment.