-
Notifications
You must be signed in to change notification settings - Fork 15
RPC return type Balance
is not always decoded
#103
Comments
I did a little debugging in
if (type.info === _polkadot_types_types__WEBPACK_IMPORTED_MODULE_9__.TypeDefInfo.Plain) {
return (0,_canvas_ui_react_util__WEBPACK_IMPORTED_MODULE_2__.truncate)((value === null || value === void 0 ? void 0 : value.toString()) || '()', TRUNCATE_TO); // TRUNCATE_TO === 16
} When When
I think there are 2 questions to be answered here:
|
While digging around for #13 I found that For your case of a starting supply of |
@awolokita This seems to be an excellent solution, tried it and changed |
@achimcc I'm glad the solution worked out well for you. Looking forward to seeing the big refactor. |
If ink!'s
erc20
example is deployed with aninitialSupply
of9999
the RPC methodtotal_supply()
does not decode the returned supply:If
1000
is chosen forinitialSupply
the value is displayed as encoded. It also works for9999
in polkadot-js:Here's the contract: erc20.contract.zip.
The return type of
total_supply
isBalance
. I suspect that there's an issue with decoding this type.The text was updated successfully, but these errors were encountered: