Closed arikan closed 5 years ago
As far as I see, the custom Kitty struct type passed into addCodecTransform
does not satisfy any of the cases, and finally throws Unknown type to decode
here.
https://github.com/paritytech/oo7/blob/master/packages/oo7-substrate/src/codec.js#L363
Whereas it should be added in the transforms
dynamically, when addCodecTransform
called in the react app.jsx constructor.
function addCodecTransform(type, transform) {
if (!transforms[type]) {
transforms[type] = transform
}
}
https://github.com/paritytech/oo7/blob/master/packages/oo7-substrate/src/codec.js#L106
Issue here was related to an outdated version of oo7-substrate being used.
To solve the issue, you need to run yarn upgrade
in the substrate-ui
folder. An update to the substrate-ui
repo should be able to solve this permanently.
Hi @shawntabrizi thank you for the tutorial, it's been very helpful. I had one issue at the very last section. I pass in the type into
addCodecTransform
in the react component constructor, but I get theUnknown type to decode
error below.I created kitties and sent them to accounts using the polkadot-js app. I created kitties for different accounts in the oo7 app, however, I got the error below while trying to decode and show the kitty cards.
I have
oo7-substrate ^0.4.11