Closed voliva closed 2 months ago
You can call getBlockHash with a future block number and it will return null, however, for genesis, it should always give you a block hash. It will be an unreachable code path for the null case. You could throw error like "Unexpected null genesis" if it ever happens.
Last missing group of functions to provide support with papi, so this closes #801
I may need help with the
genesisHash
function - I thought this would be available on the chain object directly, but it's not.I called
getBlockHash(0)
, which seems to get the job done, it seems to work when starting from genesis and from a wsUrl, but the types say it might return null. I couldn't find any case where this happens, but I'm also not sure what to do in this case.... any ideas?