decentralized-identity/ion

BitcoinClient should check for if the 'bitcoinWalletOrImportString' parameter is undefined

Open

#314 aberto em 20 de abr. de 2020

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)HTML (168 forks)batch import
good first issue

Métricas do repositório

Stars
 (1.219 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

https://github.com/decentralized-identity/sidetree/blob/a8ba6ec2a1fb809df55ce54e47339d8ac1e7df34/lib/bitcoin/BitcoinClient.ts#L47

If the admin forgets to add in either the import string or an actual IBitcoinWallet on this parameter then we should throw here. Currently, the this.bitcoinWallet member stays undefined and we throw when we try to use it.

Suggestion:

if (typeof bitcoinWalletOrImportString === 'undefined') { // throw }

// OR

// After all the initializations
if (this.bitcoinWallet === undefined) { // throw }

Guia do colaborador