diff --git a/include/fctypes.h b/include/fctypes.h index 0ac15c0..fa2368c 100644 --- a/include/fctypes.h +++ b/include/fctypes.h @@ -439,11 +439,17 @@ typedef Handle PexNodeIteratorMocks__Handle; * PexNodeSetMocks__Handle Handle, struct mocks.PexNodeSet */ typedef Handle PexNodeSetMocks__Handle; + /** * PubKeyMocks__Handle Handle, struct mocks.PubKey */ typedef Handle PubKeyMocks__Handle; +/** + * SecKeyMocks__Handle Handle, struct mocks.SecKey + */ +typedef Handle SecKeyMocks__Handle; + // Callbacks /** diff --git a/lib/cgo/coin.mocks.SecKey.go b/lib/cgo/coin.mocks.SecKey.go new file mode 100644 index 0000000..0969a44 --- /dev/null +++ b/lib/cgo/coin.mocks.SecKey.go @@ -0,0 +1,50 @@ +package main + +import "reflect" + +/* + + #include + #include + + #include "fctypes.h" +*/ +import "C" + +//export FC_mocks_SecKey_Bytes +func FC_mocks_SecKey_Bytes(__m *C.SecKeyMocks__Handle, _arg0 *C.GoSlice_) (____error_code uint32) { + _m, ok_m := lookupSecKeyMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.Bytes() + copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + return +} + +//export FC_mocks_SecKey_Null +func FC_mocks_SecKey_Null(__m *C.SecKeyMocks__Handle, _arg0 *bool) (____error_code uint32) { + _m, ok_m := lookupSecKeyMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + __arg0 := _m.Null() + *_arg0 = __arg0 + return +} + +//export FC_mocks_SecKey_Verify +func FC_mocks_SecKey_Verify(__m *C.SecKeyMocks__Handle) (____error_code uint32) { + _m, ok_m := lookupSecKeyMocksHandle(*__m) + if !ok_m { + ____error_code = FC_BAD_HANDLE + return + } + ____return_err := _m.Verify() + ____error_code = libErrorCode(____return_err) + if ____return_err == nil { + } + return +} diff --git a/lib/cgo/handles b/lib/cgo/handles index 26d69dd..21cd236 100644 --- a/lib/cgo/handles +++ b/lib/cgo/handles @@ -61,4 +61,5 @@ CGOGEN HANDLES mocks__PEX|PEXMocks CGOGEN HANDLES mocks__PexNode|PexNodeMocks CGOGEN HANDLES mocks__PexNodeIterator|PexNodeIteratorMocks CGOGEN HANDLES mocks__PexNodeSet|PexNodeSetMocks -CGOGEN HANDLES mocks__PubKey|PubKeyMocks \ No newline at end of file +CGOGEN HANDLES mocks__PubKey|PubKeyMocks +CGOGEN HANDLES mocks__SecKey|SecKeyMocks \ No newline at end of file diff --git a/lib/cgo/libfc_handle.go b/lib/cgo/libfc_handle.go index 47f19cd..7cec9ed 100644 --- a/lib/cgo/libfc_handle.go +++ b/lib/cgo/libfc_handle.go @@ -807,3 +807,17 @@ func lookupPubKeyMocksHandle(handle C.PubKeyMocks__Handle) (*mocks.PubKey, bool) func registerPubKeyMocksHandle(obj *mocks.PubKey) C.PubKeyMocks__Handle { return (C.PubKeyMocks__Handle)(registerHandle(obj)) } + +func lookupSecKeyMocksHandle(handle C.SecKeyMocks__Handle) (*mocks.SecKey, bool) { + obj, ok := lookupHandle(C.Handle(handle)) + if ok { + if obj, isOK := (obj).(*mocks.SecKey); isOK { + return obj, true + } + } + return nil, false +} + +func registerSecKeyMocksHandle(obj *mocks.SecKey) C.SecKeyMocks__Handle { + return (C.SecKeyMocks__Handle)(registerHandle(obj)) +}