我正在尝试通过 polkadotJS 在我的底层链上部署智能合约。
const unsub = await code
.tx.new( { gasLimit: 200000, value: 5000 }, true)
.signAndSend(alicePair, (result) => {
if (result.status.isInBlock || result.status.isFinalized) {
// here we have an additional field in the result, containing the blueprint
blueprint = result.blueprint;
unsub();
}else{console.log(result)}
})
但是,if 语句失败,我得到了返回:
CodeSubmittableResult {
dispatchError: undefined,
dispatchInfo: undefined,
events: [],
status: Type {
registry: TypeRegistry { createdAtHash: undefined },
createdAtHash: undefined,
isFuture: [Getter],
asFuture: [Getter],
isReady: [Getter],
asReady: [Getter],
isBroadcast: [Getter],
asBroadcast: [Getter],
isInBlock: [Getter],
asInBlock: [Getter],
isRetracted: [Getter],
asRetracted: [Getter],
isFinalityTimeout: [Getter],
asFinalityTimeout: [Getter],
isFinalized: [Getter],
asFinalized: [Getter],
isUsurped: [Getter],
asUsurped: [Getter],
isDropped: [Getter],
asDropped: [Getter],
isInvalid: [Getter],
asInvalid: [Getter]
},
blueprint: undefined,
contract: undefined
}
我不知道该怎么做,我也不知道这里出了什么问题。合约可以通过他们的 UI成功部署(当我这样做时,我可以直观地反馈那里的合约。在同一个 UI 中,我可以看到每次运行代码时交易量增加 1。
那么有谁知道我可以从这个结果中得到什么信息,或者我做错了什么?很难遵循这些文档,因为它已经过时了。