CodeChain-io / CodeChain-io/codechain-sdk-js

Throw errors when blockNumber is invalid in ChainRpc

Open
#179 0 comments 0 reactions 0 assignees View on GitHub
discussion rpc
Dominant language
TypeScript
Stars
26
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.