Open iherger opened 5 years ago
It should work with any key that supports ==
. I don't see why it wouldn't work with Address
which is a byte array, if you have a sample of the code you tried that would help debug.
This is the code we are using currently, https://github.com/melonproject/melon-subgraph/blob/master/src/mappings/PriceSource.ts#L175
We are now using string
as the key type, Address
didn't seem to work.
TypedMap currently doesn't allow for
Address
key type. It might be useful to allowAddress
and other types as key types.There is no compiler error or graph-node warning, the TypedMap object just returns null for a get request with the correct key of type
Address
.Alternatively, the documentation should be updated as to which types are currently allowed as key types.