Open
Description
Describe the bug
Regarding SNIP-12.
When calculating the encodetype of an object that includes a merkletree, the dependent types are not transitively added
To Reproduce
It can be reproduced with the following types:
{
StarknetDomain: [
{ name: "name", type: "shortstring" },
{ name: "version", type: "shortstring" },
{ name: "chainId", type: "shortstring" },
{ name: "revision", type: "shortstring" },
],
Object: [{ name: "tree", type: "merkletree", contains: "OtherObject" }],
OtherObject: [{ name: "number", type: "uint128" }]
}
Expected behavior
Object
encodeType is calculated as
"Object"("tree":"merkletree")
but it should include declaration of the other object too like this:
"Object"("tree":"merkletree")"OtherObject"("number":"uint128")
This works correctly on enums but for some reason it's not done correctly with merkletrees
Screenshots
Desktop (please complete the following information):
Node version: 18
Starknet.js version: v6.23.1 (latest)
Additional context