在我的webapp中,balances.transfer抛出了一个错误,但是staking.bondExtra正在按预期工作。它连接到westend网络。
错误:
错误:createType(调用)::Call:失败解码balances.transfer::Struct: failed on args:{“balances.transfer”:“LookupSource”,“LookupSource”:“LookupSource”}::Struct: failed on value: balances.transfer::断言失败
代码片段:
transactions = []
transactions.push(
api.tx.staking.bondExtra(rawAmount),
api.tx.balances.transfer(Address, commission);
);
const bondExtraFee = await api.tx.utility.batch(transactions).paymentInfo(substrateStashId);
return bondExtraFee.partialFee.toNumber();发布于 2021-11-09 11:40:40
这很可能是由链中大量的小数引起的。确保将balance值指定为BigInt或BN,而不是只指定number。
https://stackoverflow.com/questions/68484700
复制相似问题