Fix Compact decode hex value (#582)
* decode header is broken * Ignore length for Compact isHex check
This commit is contained in:
committed by
Jaco Greeff
parent
57fe1478ae
commit
9a4973237e
@@ -53,7 +53,7 @@ export default class Compact extends Base<UInt | Moment> implements Codec {
|
||||
return new Type(value.raw);
|
||||
} else if (isString(value)) {
|
||||
return new Type(
|
||||
isHex(value)
|
||||
isHex(value, -1, true)
|
||||
? hexToBn(value)
|
||||
: new BN(value, 10)
|
||||
);
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"logs": []
|
||||
},
|
||||
"extrinsicsRoot": "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
|
||||
"number": 0,
|
||||
"number": "0x0",
|
||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"stateRoot": "0x294c3470ae3be7555240b9d034ec19c3715ba2c3f20b92441f8cea0cab66ab56"
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
]
|
||||
},
|
||||
"extrinsicsRoot": "0x1da0d30001d07991baef3c5c65234c2e88bec659dc0d7138a7e7267e2bacbeb7",
|
||||
"number": 2918,
|
||||
"number": "0xb66",
|
||||
"parentHash": "0xb58e4d84c2e0db1cdc8c8830aa719015f8c855f29a0dff2b158a160f29f73ba0",
|
||||
"stateRoot": "0x22f6f5b6992ab87ea5f52b2732ed9e22a88643ed3a97251986857633687fbc54"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user