Closed tulpenhaendler closed 1 month ago
It also returns nothing for: https://better-call.dev/mainnet/KT1CSYNJ6dFcnsV4QJ6HnBFtdif8LJGPQiDM/storage
for KT1F3MuqvT9Yz57TgCS3EkDcKNZe9HpiavUJ it returns only 6 of the 8 existing bigmaps, one of the returned ones also has a wrong bigMapId.
Hi @tulpenhaendler, thanks for reporting this. I'm taking a look at this issue, though it might take some time since the team didn't really pay much attention to other parts of TzGo since we took over this project and I personally have very little knowledge about michelson. Based on what I understand so far, here I try to address your comments:
The methods BigmapsByIdand BigmapsByName dont actually exist
They did exist previously, but the methods were updated about 2 years ago and the readme was not updated accordingly. script.Bigmaps
is supposed to replace the two methods.
Is there a different way to reliably fetch BigMap Ids?
This should be the ideal way of fetching BigMap IDs:
ids := []int64{}
for k, v := range script.Bigmaps() {
ids = append(ids, v)
}
since script.Bigmaps
is supposed to return a mapping between map names and map IDs. I guess the current issue has something to do with parsing the micheline code. When everything is parsed and interpreted correctly, the returned mapping should give correct BigMap IDs.
The README shows that to get all the bigmaps for a given contract one would do the following:
The methods
BigmapsById
andBigmapsByName
dont actually exist, however inspired by the above, the following works:And for most contracts this works, however sometimes, as for example the contract KT1J1yVJEDkaYzJ7WuEomryEGWBNMGcUw1WA this returns a the correct bigmaps mixed into a lot of nonsense:
Is there a different way to reliably fetch BigMap Ids?