From e58ea1910564c41cc683dda5b7da05db3b29029d Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Wed, 25 Mar 2020 22:25:49 -0400 Subject: [PATCH] [cgo] refs #5 Added `coin.mocks.WalletOutput` --- include/fctypes.h | 6 ++++++ lib/cgo/coin.mocks.WalletOutput.go | 34 ++++++++++++++++++++++++++++++ lib/cgo/handles | 3 ++- lib/cgo/libfc_handle.go | 14 ++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 lib/cgo/coin.mocks.WalletOutput.go diff --git a/include/fctypes.h b/include/fctypes.h index abdb9c0..d21406a 100644 --- a/include/fctypes.h +++ b/include/fctypes.h @@ -547,6 +547,12 @@ typedef Handle WalletEnvMocks__Handle; */ typedef Handle WalletIteratorMocks__Handle; +/** + *WalletOutputMocks__Handle Handle, struct + * mocks.WalletOutput + */ +typedef Handle WalletOutputMocks__Handle; + // Callbacks /** diff --git a/lib/cgo/coin.mocks.WalletOutput.go b/lib/cgo/coin.mocks.WalletOutput.go new file mode 100644 index 0000000..01cfcad --- /dev/null +++ b/lib/cgo/coin.mocks.WalletOutput.go @@ -0,0 +1,34 @@ +package main + +/* + + #include + #include + + #include "fctypes.h" +*/ +import "C" + +//export FC_mocks_WalletOutput_GetOutput +func FC_mocks_WalletOutput_GetOutput(__m *C.WalletOutputMocks__Handle, _arg0 *C.TransactionOutput__Handle) (____error_code uint32) { + _m, ok_m := lookupWalletOutputMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.GetOutput() + *_arg0 = registerTransactionOutputHandle(&__arg0) + return +} + +//export FC_mocks_WalletOutput_GetWallet +func FC_mocks_WalletOutput_GetWallet(__m *C.WalletOutputMocks__Handle, _arg0 *C.Wallet__Handle) (____error_code uint32) { + _m, ok_m := lookupWalletOutputMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.GetWallet() + *_arg0 = registerWalletHandle(&__arg0) + return +} diff --git a/lib/cgo/handles b/lib/cgo/handles index 569cc34..fdc3bc0 100644 --- a/lib/cgo/handles +++ b/lib/cgo/handles @@ -77,4 +77,5 @@ CGOGEN HANDLES mocks__TxnSignerIterator|TxnSignerIteratorMocks CGOGEN HANDLES mocks__Wallet|WalletMocks CGOGEN HANDLES mocks__WalletAddress|WalletAddressMocks CGOGEN HANDLES mocks__WalletEnv|WalletEnvMocks -CGOGEN HANDLES mocks__WalletIterator|WalletIteratorMocks \ No newline at end of file +CGOGEN HANDLES mocks__WalletIterator|WalletIteratorMocks +CGOGEN HANDLES mocks__WalletOutput|WalletOutputMocks \ No newline at end of file diff --git a/lib/cgo/libfc_handle.go b/lib/cgo/libfc_handle.go index 5f6f735..7db4db3 100644 --- a/lib/cgo/libfc_handle.go +++ b/lib/cgo/libfc_handle.go @@ -1040,3 +1040,17 @@ func lookupWalletIteratorMocksHandle(handle C.WalletIteratorMocks__Handle) (*moc func registerWalletIteratorMocksHandle(obj *mocks.WalletIterator) C.WalletIteratorMocks__Handle { return (C.WalletIteratorMocks__Handle)(registerHandle(obj)) } + +func lookupWalletOutputMocksHandle(handle C.WalletOutputMocks__Handle) (*mocks.WalletOutput, bool) { + obj, ok := lookupHandle(C.Handle(handle)) + if ok { + if obj, isOK := (obj).(*mocks.WalletOutput); isOK { + return obj, true + } + } + return nil, false +} + +func registerWalletOutputMocksHandle(obj *mocks.WalletOutput) C.WalletOutputMocks__Handle { + return (C.WalletOutputMocks__Handle)(registerHandle(obj)) +}