builder method Null safety
override
Implementation
static InvokeHostFuncOpBuilder builder(XdrInvokeHostFunctionOp op) {
XdrHostFunction xdrHostFunction = op.function;
if (xdrHostFunction.discriminant !=
XdrHostFunctionType.HOST_FUNCTION_TYPE_CREATE_CONTRACT ||
xdrHostFunction.createContractArgs == null ||
xdrHostFunction.createContractArgs!.contractID.discriminant !=
XdrContractIDType.CONTRACT_ID_FROM_ASSET ||
xdrHostFunction.createContractArgs!.contractID.asset == null ||
xdrHostFunction.createContractArgs!.source.discriminant !=
XdrSCContractCodeType.SCCONTRACT_CODE_TOKEN) {
throw new Exception("invalid argument");
}
return InvokeHostFuncOpBuilder.forDeploySACWithAsset(
Asset.fromXdr(xdrHostFunction.createContractArgs!.contractID.asset!),
footprint: op.footprint);
}