From c90ce99c6e662ab9af5d9ed2161d882cb3bebad4 Mon Sep 17 00:00:00 2001 From: Maykel Arias Torres Date: Fri, 17 Jan 2020 23:24:57 -0500 Subject: [PATCH] [cgo] refs #116 Finalized `cipher.bitcoin` --- lib/cgo/cipher.bitcoin.go | 50 ++------------------------------------- 1 file changed, 2 insertions(+), 48 deletions(-) diff --git a/lib/cgo/cipher.bitcoin.go b/lib/cgo/cipher.bitcoin.go index 3c4584b36..d52d1977e 100644 --- a/lib/cgo/cipher.bitcoin.go +++ b/lib/cgo/cipher.bitcoin.go @@ -11,14 +11,15 @@ import ( #include #include + #include #include "skytypes.h" + #include "skyfee.h" */ import "C" //export SKY_cipher_BitcoinPubKeyRipemd160 func SKY_cipher_BitcoinPubKeyRipemd160(_pubKey *C.cipher__PubKey, _arg1 *C.cipher__Ripemd160) (____error_code uint32) { - ____error_code = 0 pubKey := *(*cipher.PubKey)(unsafe.Pointer(_pubKey)) __arg1 := cipher.BitcoinPubKeyRipemd160(pubKey) copyToBuffer(reflect.ValueOf(__arg1[:]), unsafe.Pointer(_arg1), uint(SizeofRipemd160)) @@ -27,7 +28,6 @@ func SKY_cipher_BitcoinPubKeyRipemd160(_pubKey *C.cipher__PubKey, _arg1 *C.ciphe //export SKY_cipher_BitcoinAddressFromPubKey func SKY_cipher_BitcoinAddressFromPubKey(_pubKey *C.cipher__PubKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 pubKey := *(*cipher.PubKey)(unsafe.Pointer(_pubKey)) __arg1 := cipher.BitcoinAddressFromPubKey(pubKey) *_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1)) @@ -36,7 +36,6 @@ func SKY_cipher_BitcoinAddressFromPubKey(_pubKey *C.cipher__PubKey, _arg1 *C.cip //export SKY_cipher_BitcoinAddressFromSecKey func SKY_cipher_BitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 secKey := *(*cipher.SecKey)(unsafe.Pointer(_secKey)) __arg1, ____return_err := cipher.BitcoinAddressFromSecKey(secKey) ____error_code = libErrorCode(____return_err) @@ -46,18 +45,8 @@ func SKY_cipher_BitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cip return } -//export SKY_cipher_MustBitcoinAddressFromSecKey -func SKY_cipher_MustBitcoinAddressFromSecKey(_secKey *C.cipher__SecKey, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 - secKey := *(*cipher.SecKey)(unsafe.Pointer(_secKey)) - __arg1 := cipher.MustBitcoinAddressFromSecKey(secKey) - *_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1)) - return -} - //export SKY_cipher_DecodeBase58BitcoinAddress func SKY_cipher_DecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 addr := _addr __arg1, ____return_err := cipher.DecodeBase58BitcoinAddress(addr) ____error_code = libErrorCode(____return_err) @@ -67,18 +56,8 @@ func SKY_cipher_DecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__Bitcoi return } -//export SKY_cipher_MustDecodeBase58BitcoinAddress -func SKY_cipher_MustDecodeBase58BitcoinAddress(_addr string, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 - addr := _addr - __arg1 := cipher.MustDecodeBase58BitcoinAddress(addr) - *_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1)) - return -} - //export SKY_cipher_BitcoinAddressFromBytes func SKY_cipher_BitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 b := *(*[]byte)(unsafe.Pointer(&_b)) __arg1, ____return_err := cipher.BitcoinAddressFromBytes(b) ____error_code = libErrorCode(____return_err) @@ -88,18 +67,8 @@ func SKY_cipher_BitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddre return } -//export SKY_cipher_MustBitcoinAddressFromBytes -func SKY_cipher_MustBitcoinAddressFromBytes(_b []byte, _arg1 *C.cipher__BitcoinAddress) (____error_code uint32) { - ____error_code = 0 - b := *(*[]byte)(unsafe.Pointer(&_b)) - __arg1 := cipher.MustBitcoinAddressFromBytes(b) - *_arg1 = *(*C.cipher__BitcoinAddress)(unsafe.Pointer(&__arg1)) - return -} - //export SKY_cipher_BitcoinAddress_Null func SKY_cipher_BitcoinAddress_Null(_addr *C.cipher__BitcoinAddress, _arg0 *bool) (____error_code uint32) { - ____error_code = 0 addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) __arg0 := addr.Null() *_arg0 = __arg0 @@ -108,7 +77,6 @@ func SKY_cipher_BitcoinAddress_Null(_addr *C.cipher__BitcoinAddress, _arg0 *bool //export SKY_cipher_BitcoinAddress_Bytes func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *C.GoSlice_) (____error_code uint32) { - ____error_code = 0 addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) __arg0 := addr.Bytes() copyToGoSlice(reflect.ValueOf(__arg0), _arg0) @@ -117,7 +85,6 @@ func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *C.G //export SKY_cipher_BitcoinAddress_Verify func SKY_cipher_BitcoinAddress_Verify(_addr *C.cipher__BitcoinAddress, _key *C.cipher__PubKey) (____error_code uint32) { - ____error_code = 0 addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) key := *(*cipher.PubKey)(unsafe.Pointer(_key)) ____return_err := addr.Verify(key) @@ -129,7 +96,6 @@ func SKY_cipher_BitcoinAddress_Verify(_addr *C.cipher__BitcoinAddress, _key *C.c //export SKY_cipher_BitcoinAddress_String func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg0 *C.GoString_) (____error_code uint32) { - ____error_code = 0 addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) __arg0 := addr.String() copyString(__arg0, _arg0) @@ -138,7 +104,6 @@ func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg0 *C. //export SKY_cipher_BitcoinAddress_Checksum func SKY_cipher_BitcoinAddress_Checksum(_addr *C.cipher__BitcoinAddress, _arg0 *C.cipher__Checksum) (____error_code uint32) { - ____error_code = 0 addr := *(*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) __arg0 := addr.Checksum() *_arg0 = *(*C.cipher__Checksum)(unsafe.Pointer(&__arg0)) @@ -147,7 +112,6 @@ func SKY_cipher_BitcoinAddress_Checksum(_addr *C.cipher__BitcoinAddress, _arg0 * //export SKY_cipher_BitcoinWalletImportFormatFromSeckey func SKY_cipher_BitcoinWalletImportFormatFromSeckey(_seckey *C.cipher__SecKey, _arg1 *C.GoString_) (____error_code uint32) { - ____error_code = 0 seckey := *(*cipher.SecKey)(unsafe.Pointer(_seckey)) __arg1 := cipher.BitcoinWalletImportFormatFromSeckey(seckey) copyString(__arg1, _arg1) @@ -156,7 +120,6 @@ func SKY_cipher_BitcoinWalletImportFormatFromSeckey(_seckey *C.cipher__SecKey, _ //export SKY_cipher_SecKeyFromBitcoinWalletImportFormat func SKY_cipher_SecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.cipher__SecKey) (____error_code uint32) { - ____error_code = 0 input := _input __arg1, ____return_err := cipher.SecKeyFromBitcoinWalletImportFormat(input) ____error_code = libErrorCode(____return_err) @@ -165,12 +128,3 @@ func SKY_cipher_SecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.ciph } return } - -//export SKY_cipher_MustSecKeyFromBitcoinWalletImportFormat -func SKY_cipher_MustSecKeyFromBitcoinWalletImportFormat(_input string, _arg1 *C.cipher__SecKey) (____error_code uint32) { - ____error_code = 0 - input := _input - __arg1 := cipher.MustSecKeyFromBitcoinWalletImportFormat(input) - copyToBuffer(reflect.ValueOf(__arg1[:]), unsafe.Pointer(_arg1), uint(SizeofSecKey)) - return -}