Skip to content
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

Fixes #116 Generate libsky to cgogen #117

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d929591
[cgo] Added file to generate all handles
Dec 22, 2019
e514dab
[cgo] Added generate cipher.address
Dec 22, 2019
9e6b139
[cgo] Added generate file cipher.base58.base58
Dec 22, 2019
15e375f
[cgo] Added functions helpers
Dec 22, 2019
d74a0ae
[cgo] Added generate functions cipher.bitcoin
Dec 22, 2019
6bff314
[cgo] Remove duplicate function `SKY_cipher_PubKeyRipemd160`
Dec 23, 2019
aa34921
[cgo] Generate and fixes cipher.crypto
Dec 24, 2019
18b6a7c
[cgo] Generate and fixes cipher.hash
Dec 24, 2019
0d7bcf4
[cgo] Added file conf handles
Jan 1, 2020
0524979
[cgo] refs added file to conf Handle
Jan 3, 2020
36d72e5
[include] Remove old definitions the `Handles`
Jan 7, 2020
2777eaf
[cgo] Correcting parse functions handles
Jan 7, 2020
2acdab2
[cgo] Added all typedata to convert Handle in file conf
Jan 8, 2020
cb16807
[cgo] Clean all Handle in `skytypes.h`
Jan 8, 2020
12f8b04
remove vendor
Jan 17, 2020
63caed3
remove .history folder
Jan 17, 2020
e5d6b9b
add result generate to cgogen
Jan 17, 2020
1987b56
Added vendor
Jan 17, 2020
6c41926
[cgo] refs #116 Added typedata `SortableTransactions`
Jan 17, 2020
8bb1585
[cgo] refs #116 Finalized `coin.block ` and `coin.transactions`
Jan 17, 2020
07f7816
[vendor] refs #116 Remove old vendor
Jan 17, 2020
2442c2b
[Makefile] refs #116 Update tag `make install-linters`
Jan 17, 2020
49c34a2
[cgo] finalized coin.block
Jan 17, 2020
452446e
[golangci-lint] refs #116 Exclude vendor to linter
Jan 18, 2020
659c57a
[cgo] refs #116 FInalized `cipher.bip32`
Jan 18, 2020
61b077e
[cgo] refs #116 Finalized `cipher.bip44`
Jan 18, 2020
051aada
[cgo] refs #116 Finalized `cli.check_balance`
Jan 18, 2020
e4f888f
[cgo] refs #116 Finalized `cli.cli`
Jan 18, 2020
916426a
[cgo] refs #116 Finalized `cipher.base58`
Jan 18, 2020
e7628aa
[cgo] refs #116 Finalized `cipher.bip39`
Jan 18, 2020
c90ce99
[cgo] refs #116 Finalized `cipher.bitcoin`
Jan 18, 2020
107646e
[cgo] refs #116 Finalized `cipher.crypto`
Jan 18, 2020
d71e80e
[cgo] refs #116 Finalized `cli.create_rawtx`
Jan 18, 2020
aa9ccf7
[cgo] refs #116 FInalized `cli.outputs`
Jan 18, 2020
6588240
[cgo] refs #116 Finalized `params.distribution`
Jan 18, 2020
ada4591
[cgo] refs #116 Finalized `params.droplet`
Jan 18, 2020
4b89586
[cgo] refs #116 Finalized `transaction.hours`
Jan 18, 2020
628e3ac
[cgo] refs #116 Finalized `cipher.hash`
Jan 18, 2020
86b0bae
[cgo] refs #116 Finalized `transaction.choose`
Jan 18, 2020
834f0bd
[cgo] refs #116 Finalized `cli.generate_wallet`
Jan 18, 2020
221d4ab
[cgo] refs #116 Finalized `cipher.encrypt`
Jan 18, 2020
ae07666
[cgo] refs #116 FInalized `cipher.secp256k1`
Jan 18, 2020
6c0d131
[cgo] refs #116 Finalized `cli.add_private_key`
Jan 18, 2020
7691494
[cgo] refs #116 Finalized `cli.generate_addrs`
Jan 18, 2020
64fde6f
[cgo] refs #116 Format with `make format`
Jan 18, 2020
6435a58
[cgo] refs #116 Export coin.outputs
Jan 18, 2020
56ecb54
[cgo] refs # Regerate coin.transactions
Jan 25, 2020
64c0c8a
[cgo] refs #116 Correcting name the export var Handle
Jan 25, 2020
190d33d
[cgo] refs #116 Clean old definitions in `libsky_handle.go`
Jan 27, 2020
88ca0cc
[include] refs #116 Correcting parse to `make format-libc`
Jan 29, 2020
9057fdc
[cgo] refs #116 Added new functions helpers in `cipher.bip32.bip32.go`
Jan 29, 2020
28e5b44
[cgo] refs #116 Added functions helpers in `coin.outputs`
Jan 29, 2020
fea15d3
[test-libsky] refs #116 Correcting declare functions and test to chan…
Jan 29, 2020
6fcaa31
[travis] refs #116 Using gox the SkycoinProject
Jan 29, 2020
60bd7c1
[cgo] refs #116 Added new helpers
Jan 29, 2020
c49adec
[cgo] refs #116 Tried to separate the coin_Uxarray the GoSLice and cl…
Jan 29, 2020
14a0870
[test-libsky] refs #116 FInalized `cipher.bip32`
Jan 30, 2020
b9ab52f
[test-libsky] refs #116 Finalized `cipher.bip44`
Jan 31, 2020
bde842e
[test-libsky] refs #116 FInalized `coin.block`
Jan 31, 2020
98382c3
[test-libsky] refs #116 Finalized coin.block
Jan 31, 2020
5d2efdb
[test-libsky] refs #116 Correcting parse and declare type data
Jan 31, 2020
d9a0696
[test-libc] refs #116 Added tags all suite test
Jan 31, 2020
2eb3335
[cgo][test-libc] FInalized `cipher.bitcoin`
Feb 2, 2020
f9fb2fc
[cgo][test-libc] refs #116 Finalized `coin.outputs`
Feb 2, 2020
1d0c4af
[test-libc] refs #116 FInalized cipher.bip32
Feb 2, 2020
f8a5239
[cgo] refs #116 Finalized coin.block
Feb 2, 2020
a68941d
[cgo] refs #116 Clena memory to handle
Feb 2, 2020
71dc78d
[cgo] refs #116 Clean old definitions in `libsky_handle.go`
Feb 2, 2020
acb4e4d
[cgo] refs #116 To detect automatic GoSlice
Feb 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,5 @@ histogram
qemu_*
core
#Generate in Dolphin
.directory
.directory
.history
1 change: 1 addition & 0 deletions .golangci.libcgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ run:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- /usr/local/go/src
- vendor

# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
- PATH_DIR: "$GOPATH/src/github.com/fibercrypto/libskycoin/"
install:
# Install gox
- go get github.com/gz-c/gox
- go get github.com/mitchellh/gox
- go get -t ./...
- make install-linters
- make install-deps-libc
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ install-deps-Darwin: ## Install deps on Mac OSX

install-linters: install-linters-$(UNAME_S) ## Install linters
go get -u github.com/FiloSottile/vendorcheck
cat ./ci-scripts/install-golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.10.2
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(shell go env GOPATH)/bin v1.18.0

install-deps-skyapi-Linux:
mkdir -p deps
Expand Down
4 changes: 4 additions & 0 deletions include/cipher.base58.base58.go.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
typedef struct {
GoInt8_ decode[128];
GoUint8_ encode[58];
} base58__Alphabet;
4 changes: 4 additions & 0 deletions include/cipher.bip32.bip32.go.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
typedef struct {
GoInt32_ _unnamed;
bool impossibleChild;
} bip32__Error;
2 changes: 1 addition & 1 deletion include/cipher.bip44.bip44.go.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
typedef GoUint32_ bip44_CoinType;
typedef GoUint32_ bip44__CoinType;
16 changes: 16 additions & 0 deletions include/cli.check_balance.go.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
typedef struct {
GoString_ Coins;
GoString_ Hours;
} cli__Balance;
typedef struct {
cli__Balance Confirmed;
cli__Balance Spendable;
cli__Balance Expected;
GoString_ Address;
} cli__AddressBalances;
typedef struct {
cli__Balance Confirmed;
cli__Balance Spendable;
cli__Balance Expected;
GoSlice_ Addresses;
} cli__BalanceResult;
27 changes: 21 additions & 6 deletions include/cli.cli.go.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
typedef struct {
void* data; ///< Pointer to buffer containing slice data.
GoInt_ len; ///< Number of items stored in slice buffer
GoInt_ cap; ///< Maximum number of items that fits in this slice
///< considering allocated memory and item type's
///< size.
} cli__PasswordFromBytes;
GoString_ DataDir;
GoString_ Coin;
GoString_ RPCAddress;
GoString_ RPCUsername;
GoString_ RPCPassword;
} cli__Config;
typedef struct {
GoInt32_ _unnamed;
} cli__WalletLoadError;
typedef struct {
GoInt32_ _unnamed;
} cli__WalletSaveError;
typedef GoInterface_ cli__PasswordReader;
typedef struct {
} cli__PasswordFromTerm;

typedef struct {
void* data;
GoInt_ len;
GoInt_ cap;
} cli__PasswordFromBytes;
23 changes: 18 additions & 5 deletions include/cli.create_rawtx.go.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
/**
* Structure used to specify amounts transferred in a transaction.
*/
typedef struct {
GoString_ Addr; ///< Sender / receipient address.
GoInt64_ Coins; ///< Amount transferred (e.g. measured in SKY)
GoString_ Addr;
GoUint64_ Coins;
} cli__SendAmount;
typedef struct {
GoString_ Addr;
GoString_ Coins;
} cli__sendAmountJSON;
typedef struct {
GoString_ Wallet;
GoString_ Address;
} cli__walletAddress;
typedef GoInterface_ cli__GetOutputser;
typedef struct {
GoString_ WalletID;
GoString_ Address;
GoString_ ChangeAddress;
GoSlice_ SendAmounts;
cli__PasswordReader Password;
} cli__createRawTxnArgs;
3 changes: 3 additions & 0 deletions include/cli.outputs.go.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typedef struct {
readable__UnspentOutputsSummary Outputs;
} cli__OutputsResult;
5 changes: 2 additions & 3 deletions include/coin.outputs.go.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ typedef struct {
GoUint64_ Time;
GoUint64_ BkSeq;
} coin__UxHead;


typedef struct {
cipher__SHA256 SrcTransaction;
cipher__Address Address;
GoUint64_ Coins;
GoUint64_ Hours;
} coin__UxBody;

typedef GoMap_ coin__UxHashSet;
typedef GoMap_ coin__AddressUxOuts;
typedef struct {
coin__UxHead Head;
coin__UxBody Body;
Expand Down
8 changes: 8 additions & 0 deletions include/params.distribution.go.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
typedef struct {
GoUint64_ MaxCoinSupply;
GoUint64_ InitialUnlockedCount;
GoUint64_ UnlockAddressRate;
GoUint64_ UnlockTimeInterval;
GoSlice_ Addresses;
GoSlice_ addressesDecoded;
} params__Distribution;
9 changes: 8 additions & 1 deletion include/skytypes.gen.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// clang-format off
#include <stdbool.h>
#include "api.client.go.h"

#include "cipher.hash.go.h"
Expand All @@ -10,9 +11,11 @@
#include "cipher.secp256k1-go.secp256k1-go2.field.go.h"
#include "cipher.secp256k1-go.secp256k1-go2.xy.go.h"
#include "cipher.secp256k1-go.secp256k1-go2.xyz.go.h"
#include "cipher.base58.base58.go.h"

#include "cli.cli.go.h"
#include "cli.create_rawtx.go.h"
#include "cli.check_balance.go.h"

#include "coin.transactions.go.h"
#include "coin.block.go.h"
Expand All @@ -31,4 +34,8 @@
#include "transaction.choose.go.h"
#include "api.send.go.h"

#include "cipher.bip32.path.go.h"
#include "cipher.bip32.bip32.go.h"
#include "cipher.bip32.path.go.h"
#include "cipher.bip44.bip44.go.h"

#include "params.distribution.go.h"
92 changes: 20 additions & 72 deletions include/skytypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ typedef GoUint8_ poly1305__Key[32];
*/
typedef GoInt64_ Handle;

/**
* Webrpc Client Handle
*/
typedef Handle WebRpcClient__Handle;

/**
* Wallet Handle
*/
Expand Down Expand Up @@ -226,17 +221,6 @@ typedef Handle GoStringMap_;
*/
typedef Handle Wallets__Handle;

/**
* ReadableOutputSet Handle
* */
typedef Handle ReadableOutputSet_Handle;

/**
* CreateTransactionParams wallet.CreateTransactionParams
*/
typedef Handle CreateTransactionParams__Handle;


/**
* CollectionWallets Handle, slice of Wallet
*/
Expand Down Expand Up @@ -304,26 +288,6 @@ typedef Handle GetOutputser__Handle;
*/
typedef Handle PasswordReader__Handle;

/**
* Memory handle to perform Skycoin RPC API calls
* encrypted wallets.
*/
typedef Handle WebRpcClient__Handle;

/**
* Memory handle providing access to wallet data
*/
typedef Handle Wallet__Handle;

/**
* Memory handle Options Handle
*/
typedef Handle Options__Handle;

/**
* Memory handle to access to Skycoin CLI configuration
*/
typedef Handle Config__Handle;
/**
* Memory handle to access to coin.Transaction
*/
Expand Down Expand Up @@ -377,88 +341,72 @@ typedef Handle BlockHeader__Handle;
* Memory handle to access to cli.BalanceResult
*/

typedef Handle BalanceResult_Handle;
typedef Handle BalanceResult__Handle;

/**
* Memory handle to access to api.SpendResult
* Memory handle to access to cli.TxnResult
*/

typedef Handle SpendResult_Handle;

/**
* Memory handle to access to coin.Transactions
*/

typedef Handle TransactionResult_Handle;
typedef Handle TransactionResult__Handle;

/**
* Memory handle to access to coin.SortableTransactions
*/

typedef Handle SortableTransactions_Handle;

/**
* Memory handle to access to wallet.Notes
*/

/**
* Memory handle to access to wallet.ReadableNotes
*/

typedef Handle WalletReadableNotes_Handle;
typedef Handle SortableTransactions__Handle;

/**
* Memory handle to access to webrpc.OutputsResult
*/

typedef Handle OutputsResult_Handle;
typedef Handle OutputsResult__Handle;

/**
* Memory handle to access to webrpc.StatusResult
* Memory handle to access to cli.StatusResult
*/

typedef Handle StatusResult_Handle;
typedef Handle StatusResult__Handle;

/**
* Memory handle to access to coin.AddressUxOuts
*/

typedef Handle AddressUxOuts_Handle;
typedef Handle AddressUxOuts__Handle;

/**
* Memory handle to access to readable.BuildInfo (BuildInfo)
*/

typedef Handle BuildInfo_Handle;
typedef Handle BuildInfo__Handle;

/**
* Memory handle to access to readable.UnspentOutputsSummary
* (UnspentOutputsSummary)
*/

typedef Handle ReadableUnspentOutputsSummary_Handle;
typedef Handle ReadableUnspentOutputsSummary__Handle;

/**
* Memory handle for hash (ripemd160.digest)
*/

typedef Handle Hash_Handle;
typedef Handle Hash__Handle;

/**
* Handle for Number type
*/

typedef Handle Number_Handle;
* Handle for readable.UnspentOutputsSummary
* */
typedef Handle UnspentOutputsSummary__Handle;

/**
* Handle for Signature type
*/
* Handle for coin.SortableTransactions
* */
typedef Handle SortableTransactions__Handle;

typedef Handle Signature_Handle;
/**
* Handle for readable.UnspentOutputsSummary
* Handle for cipher.Addresser
* */
typedef Handle UnspentOutputsSummary_Handle;

typedef Handle Addresser__Handle;

typedef GoUint32_ (*FeeCalcFunc)(Transaction__Handle handle, GoUint64_* pFee, void* context);

Expand Down
19 changes: 7 additions & 12 deletions include/transaction.choose.go.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
/**
* Skycoin transaction.
*
* Instances of this struct are included in blocks.
*/
typedef struct {
cipher__SHA256 Hash; ///< Hash of underlying UxOut.
GoUint64_ BkSeq; ///< Block height corresponding to the
///< moment balance calculation is performed at.
cipher__Address Address; ///< Account holder address.
GoUint64_ Coins; ///< Coins amount (e.g. in SKY).
GoUint64_ Hours; ///< Balance of Coin Hours generated by underlying UxOut, depending on UxOut's head time.
cipher__SHA256 Hash;
GoUint64_ BkSeq;
GoUint64_ Time;
cipher__Address Address;
GoUint64_ Coins;
GoUint64_ InitialHours;
GoUint64_ Hours;
cipher__SHA256 SrcTransaction;
} transaction__UxBalance;
} transaction__UxBalance;
Loading