-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Hi,
We've been trying to read dict from tonapi with no success.
The contract method returns Dict<uint16, uint64>. No matter the HashmapOptions, trying to read it throws this exception
Trying to replicate the issue I've written such a test:
` HashmapOptions<uint, CellSlice> opt = new HashmapOptions<uint, CellSlice>()
{
KeySize = 32,
Serializers = new HashmapSerializers<uint, CellSlice>
{
Key = k => new BitsBuilder(32).StoreUInt(k, 32).Build(),
Value = v => new CellBuilder().Build()
},
Deserializers = new HashmapDeserializers<uint, CellSlice>
{
Key = k => (uint)k.Parse().LoadUInt(32),
Value = v => v.Parse()
}
};
HashmapE<uint, CellSlice> hm = new(opt);
hm.Set(0,IntToCell(600000000));
hm.Set(1,IntToCell(250000000));
hm.Set(2,IntToCell(150000000));
Cell cell = builder.StoreDict<uint, CellSlice>(hm).Build();
var result = cell.Parse().ReadDict(opt);
static CellSlice IntToCell(uint x) => new CellBuilder().StoreUInt(x, 64).Build().Parse();
`
As you can see I'm using HashmapOptions straight from your Docs. I tried several other configurations as well, with various types, key lengths and (de)serilizers.
Even though the stored hashmap contain values, the parsed and read one has always 0 entries.
We'd be happy to continue using TON, but for that we need this basic funcionality to work.
Please advice.