(addr common.Address, initMethod string, args []byte)
| 65 | } |
| 66 | |
| 67 | func BuildNativeTransaction(addr common.Address, initMethod string, args []byte) *types.MutableTransaction { |
| 68 | bf := new(bytes.Buffer) |
| 69 | builder := vm.NewParamsBuilder(bf) |
| 70 | builder.EmitPushByteArray(args) |
| 71 | builder.EmitPushByteArray([]byte(initMethod)) |
| 72 | builder.EmitPushByteArray(addr[:]) |
| 73 | builder.EmitPushInteger(big.NewInt(0)) |
| 74 | builder.Emit(vm.SYSCALL) |
| 75 | builder.EmitPushByteArray([]byte(NATIVE_INVOKE_NAME)) |
| 76 | |
| 77 | tx := NewInvokeTransaction(builder.ToArray()) |
| 78 | tx.GasLimit = math.MaxUint64 |
| 79 | return tx |
| 80 | } |
| 81 | |
| 82 | func BuildNativeInvokeCode(contractAddress common.Address, version byte, method string, params []interface{}) ([]byte, error) { |
| 83 | builder := vm.NewParamsBuilder(new(bytes.Buffer)) |
nothing calls this directly
no test coverage detected