Open chidg opened 1 year ago
@alecdwm can this issue be closed ?
Not yet - maybe when CAPI drops?
Thanks to Papi we now have Partial<T>
instead of any
for decoded data:
https://github.com/TalismanSociety/talisman/blob/cfcd47f8b5ee14a0b1fe0413698d6a43b9277e5b/packages/balances/src/modules/SubstrateEquilibriumModule.ts#L121-L137
https://github.com/TalismanSociety/talisman/blob/cfcd47f8b5ee14a0b1fe0413698d6a43b9277e5b/packages/balances/src/modules/SubstrateEquilibriumModule.ts#L343-L361
In the future we can also investigate some papi-idiomatic ways to validate these types against the chain metadata
Describe the bug A lack of typing on one variable in
SubEquilibriumModule
allowed a major bug to occur ThetokenBalances
variable here is untyped, which means the value returned when this object is accessed by key here can be undefined, but it is typed asany
.For engineering: Test Please write a couple of unit test that cover the cases of balance queries containing defined and undefined free values.