【发布时间】:2022-08-03 02:31:54
【问题描述】:
调试智能合约测试,我看到以下操作:
const alice_Before = toBN(web3.utils.toBN(await web3.eth.getBalance(alice)));
toBN 在哪里
static toBN(num) {
return web3.utils.toBN(num)
}
如果我 console.log 这两个选项它们看起来像这样,地址中有一定的平衡:
BN {
negative: 0,
words: [ 39940619, 64700551, 7238971, 54128420, 49303 ],
length: 5,
red: null
}
谁能帮助理解为什么 BN 转换必须进行两次?
标签: web3js bignumber.js