forked from filecoin-project/filecoin-ffi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes_fvm.go
More file actions
80 lines (67 loc) · 2.43 KB
/
Copy pathtypes_fvm.go
File metadata and controls
80 lines (67 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//go:build fvm
package cgo
/*
#cgo LDFLAGS: -L${SRCDIR}/..
#cgo pkg-config: ${SRCDIR}/../filcrypto.pc
#include "../filcrypto.h"
#include <stdlib.h>
*/
import "C"
type FvmRegisteredVersion C.FvmRegisteredVersion_t
type FvmMachine C.InnerFvmMachine_t
type FvmMachineExecuteResponse C.FvmMachineExecuteResponse_t
type resultFvmMachine C.Result_InnerFvmMachine_ptr_t
type resultFvmMachineExecuteResponse C.Result_FvmMachineExecuteResponse_t
func (ptr *resultFvmMachineExecuteResponse) statusCode() FCPResponseStatus {
return FCPResponseStatus(ptr.status_code)
}
func (ptr *resultFvmMachineExecuteResponse) errorMsg() *SliceBoxedUint8 {
return (*SliceBoxedUint8)(&ptr.error_msg)
}
func (ptr *resultFvmMachineExecuteResponse) destroy() {
if ptr != nil {
C.destroy_fvm_machine_execute_response((*C.Result_FvmMachineExecuteResponse_t)(ptr))
ptr = nil
}
}
func (ptr *resultFvmMachine) statusCode() FCPResponseStatus {
return FCPResponseStatus(ptr.status_code)
}
func (ptr *resultFvmMachine) errorMsg() *SliceBoxedUint8 {
return (*SliceBoxedUint8)(&ptr.error_msg)
}
func (ptr *resultFvmMachine) destroy() {
if ptr != nil {
C.destroy_create_fvm_machine_response((*C.Result_InnerFvmMachine_ptr_t)(ptr))
ptr = nil
}
}
func (ptr *FvmMachine) Destroy() {
if ptr != nil {
C.drop_fvm_machine((*C.InnerFvmMachine_t)(ptr))
ptr = nil
}
}
func (r FvmMachineExecuteResponse) copy() FvmMachineExecuteResponseGo {
return FvmMachineExecuteResponseGo{
ExitCode: uint64(r.exit_code),
ReturnVal: (*SliceBoxedUint8)(&r.return_val).copy(),
GasUsed: uint64(r.gas_used),
PenaltyHi: uint64(r.penalty_hi),
PenaltyLo: uint64(r.penalty_lo),
MinerTipHi: uint64(r.miner_tip_hi),
MinerTipLo: uint64(r.miner_tip_lo),
BaseFeeBurnHi: uint64(r.base_fee_burn_hi),
BaseFeeBurnLo: uint64(r.base_fee_burn_lo),
OverEstimationBurnHi: uint64(r.over_estimation_burn_hi),
OverEstimationBurnLo: uint64(r.over_estimation_burn_lo),
RefundHi: uint64(r.refund_hi),
RefundLo: uint64(r.refund_lo),
GasRefund: int64(r.gas_refund),
GasBurned: int64(r.gas_burned),
ExecTrace: (*SliceBoxedUint8)(&r.exec_trace).copy(),
FailureInfo: string((*SliceBoxedUint8)(&r.failure_info).slice()),
Events: (*SliceBoxedUint8)(&r.events).copy(),
EventsRoot: (*SliceBoxedUint8)(&r.events_root).copy(),
}
}