Closed SeavantUUz closed 4 years ago
After step by step debug, finally I realized that the type info is to help amino know how a interface can be converted to a concrete type(in nested) or the whole struct is registered to cdc(in outer).
So, if I created a Account interface and rename current Account struct, I can get what I excepted result.
I think it is weired, so I want to know why.
define two structure:
and
then registered Account into cdc:
and marshal it:
and result:
account:
resultAccount:
And you see, after marshal account includes type/value infomation(aka. chain/Account). But when nested in other structure, the infomation loss.
I wander why that happend and is there a correct way for nested structure can keep it's type info ?
Thx.