codechain-sdk-js icon indicating copy to clipboard operation
codechain-sdk-js copied to clipboard

Throw errors when blockNumber is invalid in ChainRpc

Open joojis opened this issue 6 years ago • 0 comments

Currently, getBalance and getNonce are able to resolve null when no such block exists. (the given blockNumber is too big) For TypeScript users, they should put the type guard for every getBalance and getNonce.

The problem is, a type guard is useless if the users use a valid block number only.

Methods using blockNumber parameter

  • getBalance
  • getNonce
  • getRegularKey
  • getRegularKeyOwner
  • getAsset
  • getAssetScheme*
  • getBlock
  • getBlockHash
  • isAssetSpent

joojis avatar Sep 12 '18 07:09 joojis