-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lib] Export cipher and cli functions to be reused via libskycoin #968
Comments
It depends on how much you want to export versus how much you want to implement in the code using libskycoin. At minimum you will want to export the cipher methods. You could potentially reimplement the CLI methods as needed. Looking at the teller code, which uses the cli library natively to sign transactions:
For
But likely most of the public methods in |
lib/cgo/cipher.address.go:41:// export SKY_Cipher_AddressFromPubKey lib/cgo/cipher.address.go:49:// export SKY_Cipher_AddressFromSecKey lib/cgo/cipher.address.go:57:// export SKY_Cipher_BitcoinDecodeBase58Address
…Address => SKY_Cipher_DecodeBase58Address
… . skycoinlib => libskycoin
+func SKY_Cipher_Address_BitcoinBytes(_addr *C.Address, _ret *C.uchar) { +func SKY_Cipher_Address_Verify(_addr *C.Address, _key *C.PubKey) C.uint { +func SKY_Cipher_Address_String(_addr *C.Address) string { +func SKY_Cipher_Address_BitcoinString(_addr *C.Address) string { +func SKY_Cipher_Address_Checksum(_addr *C.Address, _ret *C.Checksum) { +func SKY_Cipher_Address_BitcoinChecksum(_addr *C.Address, _ret *C.Checksum) {
+func SKY_Cipher_DecodeBase58Address(_strAddr string, _retAddr *C.Address) C.uint { +func SKY_Cipher_AddressFromPubKey(_pubKey *C.PubKey, _retAddr *C.Address) { +func SKY_Cipher_AddressFromSecKey(_secKey *C.SecKey, _retAddr *C.Address) { +func SKY_Cipher_BitcoinDecodeBase58Address(_strAddr string, _retAddr *C.Address) C.uint { +func SKY_Cipher_BitcoinAddressFromPubkey(_pubkey *C.PubKey) string { +func SKY_Cipher_BitcoinWalletImportFormatFromSeckey(_seckey *C.SecKey) string { +func SKY_Cipher_BitcoinAddressFromBytes(_b *C.uchar, _sz C.size_t, _retAddr *C.Address) C.uint { +func SKY_Cipher_SecKeyFromWalletImportFormat(_input string, _seckey *C.SecKey) C.uint {
This would also be great for the Java, Objective-C and Javascript libraries produced through GopherJS and GoMobile. |
…to export cipher functions
@samuelvisscher do you need client libs for those languages ? We could build some as well (and test'em). |
+extern unsigned int SKY_CLI_CreateRawTxFromWallet(Handle p0, GoString p1, GoString p2, _GoSlice* p3, Transaction* p4); +extern unsigned int SKY_CLI_CreateRawTxFromAddress(Handle p0, GoString p1, GoString p2, GoString p3, _GoSlice p4, Transaction* p5); +extern void SKY_CLI_CreateRawTx(Handle p0, Wallet* p1, _GoSlice p2, GoString p3, _GoSlice p4, Transaction* p5); +extern void SKY_CLI_NewTransaction(_GoSlice* p0, GoSlice p1, GoSlice p2, Transaction* p3);
…ty' in LDFLAGS for test_libskycoin_static
... and other minor enhancements
…segfault in test_address_wrong [====] Synthesis: Tested: 3 | Passing: 2 | Failing: 1 | Crashing: 0
…types.h Fixes error in GNU/Linux : Go type not supported in export: [4]_Ctype_uchar
…n cipher address API [====] Synthesis: Tested: 3 | Passing: 2 | Failing: 1 | Crashing: 0
…t params of type GoSlice
TODO: lots of compilation warnings array type 'SHA256' (aka 'unsigned char [32]') is not assignable
…tests [====] Synthesis: Tested: 3 | Passing: 2 | Failing: 1 | Crashing: 0
…returned as uint32 TODO: Standardize use of libErrorCode function TODO: Define useful error codes
…tdevHan_t922_libskycoin_test' into olemis_t968_libskycoin_cipher_cli
…crypto.go Inplace memory C-to-go type casts. TODO: Error codes [====] Synthesis: Tested: 2 | Passing: 2 | Failing: 0 | Crashing: 0
Cipher and CLI functionality will be needed elsewhere . It should be available for reuse in libskycoin .
Cc @gz-c feel free to highlight functions to be exported this way
The text was updated successfully, but these errors were encountered: