Skip to content

Commit

Permalink
[cgo] refs fibercrypto#116 Finalized cli.check_balance
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Jan 18, 2020
1 parent 61b077e commit 051aada
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
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{create_rawtx.go.h
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;
25 changes: 22 additions & 3 deletions lib/cgo/cli.check_balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,37 @@ import (
#include <stdlib.h>
#include "skytypes.h"
#include "skyfee.h"
*/
import "C"

//export SKY_cli_CheckWalletBalance
func SKY_cli_CheckWalletBalance(_c *C.GetOutputser__Handle, _walletFile string, _arg2 *C.BalanceResult__Handle) (____error_code uint32) {
__c, okc := lookupGetOutputserHandle(*_c)
if !okc {
____error_code = SKY_BAD_HANDLE
return
}
c := *__c
walletFile := _walletFile
__arg2, ____return_err := cli.CheckWalletBalance(c, walletFile)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
*_arg2 = registerBalanceResultHandle(__arg2)
}
return
}

//export SKY_cli_GetBalanceOfAddresses
func SKY_cli_GetBalanceOfAddresses(_c C.GetOutputser__Handle, _addrs []string, _arg2 *C.BalanceResult_Handle) (____error_code uint32) {
c, okc := lookupGetOutputserHandle(_c)
func SKY_cli_GetBalanceOfAddresses(_c *C.GetOutputser__Handle, _addrs []string, _arg2 *C.BalanceResult__Handle) (____error_code uint32) {
__c, okc := lookupGetOutputserHandle(*_c)
if !okc {
____error_code = SKY_BAD_HANDLE
return
}
c := *__c
addrs := *(*[]string)(unsafe.Pointer(&_addrs))
__arg2, ____return_err := cli.GetBalanceOfAddresses(*c, addrs)
__arg2, ____return_err := cli.GetBalanceOfAddresses(c, addrs)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
*_arg2 = registerBalanceResultHandle(__arg2)
Expand Down

0 comments on commit 051aada

Please sign in to comment.