We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a4e92f1 + 55d72a8 commit 2b26fbbCopy full SHA for 2b26fbb
lib/serializer/src/SerializerValidation.js
@@ -109,10 +109,20 @@ var _my = {
109
}
110
111
this.no_overflow64(value, field_name, unsigned);
112
+ // BigInteger#isBigInteger https://github.com/cryptocoinjs/bigi/issues/20
113
+ // (code copied from no_overflow64)
114
+ if (value.t !== undefined && value.s !== undefined) {
115
+ value = value.toString();
116
+ }
117
if (typeof value === "number") {
118
value = "" + value;
119
- return Long.fromString(value, unsigned);
120
+ value = value.trim();
121
+ var long_value = Long.fromString(value, unsigned);
122
+ if (long_value.toString() !== value) {
123
+ throw new Error(`Unable to safely convert ${field_name} ${value} to long`);
124
125
+ return long_value;
126
},
127
128
to_string(value, field_name = "") {
0 commit comments