diff --git a/include/fctypes.h b/include/fctypes.h index f6cf607..2aa4300 100644 --- a/include/fctypes.h +++ b/include/fctypes.h @@ -477,10 +477,16 @@ typedef Handle TransactionInputMocks__Handle; typedef Handle TransactionInputIteratorMocks__Handle; /** - * TransactionInput__Handle Handle, struct core.TransactionInput + * TransactionInput__Handle Handle, interface core.TransactionInput */ typedef Handle TransactionInput__Handle; +/** + * TransactionIteratorMocks__Handle Handle, struct + * mocks.TransactionIteratorMocks + */ +typedef Handle TransactionIteratorMocks__Handle; + // Callbacks /** diff --git a/lib/cgo/coin.mocks.TransactionIterator.go b/lib/cgo/coin.mocks.TransactionIterator.go new file mode 100644 index 0000000..623dd86 --- /dev/null +++ b/lib/cgo/coin.mocks.TransactionIterator.go @@ -0,0 +1,46 @@ +package main + +/* + + #include + #include + + #include "fctypes.h" +*/ +import "C" + +//export FC_mocks_TransactionIterator_HasNext +func FC_mocks_TransactionIterator_HasNext(__m *C.TransactionIteratorMocks__Handle, _arg0 *bool) (____error_code uint32) { + _m, ok_m := lookupTransactionIteratorMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.HasNext() + *_arg0 = __arg0 + return +} + +//export FC_mocks_TransactionIterator_Next +func FC_mocks_TransactionIterator_Next(__m *C.TransactionIteratorMocks__Handle, _arg0 *bool) (____error_code uint32) { + _m, ok_m := lookupTransactionIteratorMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.Next() + *_arg0 = __arg0 + return +} + +//export FC_mocks_TransactionIterator_Value +func FC_mocks_TransactionIterator_Value(__m *C.TransactionIteratorMocks__Handle, _arg0 *C.Transaction__Handle) (____error_code uint32) { + _m, ok_m := lookupTransactionIteratorMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.Value() + *_arg0 = registerTransactionHandle(&__arg0) + return +} diff --git a/lib/cgo/handles b/lib/cgo/handles index 97519e4..d06f2b4 100644 --- a/lib/cgo/handles +++ b/lib/cgo/handles @@ -68,4 +68,5 @@ CGOGEN HANDLES mocks__StringAddress|StringAddressMocks CGOGEN HANDLES mocks__Transaction|TransactionMocks CGOGEN HANDLES mocks__TransactionInput|TransactionInputMocks CGOGEN HANDLES mocks__TransactionInputIterator|TransactionInputIteratorMocks -CGOGEN HANDLES core__TransactionInput|TransactionInput \ No newline at end of file +CGOGEN HANDLES core__TransactionInput|TransactionInput +CGOGEN HANDLES mocks__TransactionIterator|TransactionIteratorMocks \ No newline at end of file diff --git a/lib/cgo/libfc_handle.go b/lib/cgo/libfc_handle.go index 0aa6164..90fc6c9 100644 --- a/lib/cgo/libfc_handle.go +++ b/lib/cgo/libfc_handle.go @@ -901,3 +901,16 @@ func lookupTransactionInputHandle(handle C.TransactionInput__Handle) (*core.Tran func registerTransactionInputHandle(obj *core.TransactionInput) C.TransactionInput__Handle { return (C.TransactionInput__Handle)(registerHandle(obj)) } +func lookupTransactionIteratorMocksHandle(handle C.TransactionIteratorMocks__Handle) (*mocks.TransactionIterator, bool) { + obj, ok := lookupHandle(C.Handle(handle)) + if ok { + if obj, isOK := (obj).(*mocks.TransactionIterator); isOK { + return obj, true + } + } + return nil, false +} + +func registerTransactionIteratorMocksHandle(obj *mocks.TransactionIterator) C.TransactionIteratorMocks__Handle { + return (C.TransactionIteratorMocks__Handle)(registerHandle(obj)) +}