Skip to content

Commit

Permalink
[cgo] refs fibercrypto#116 Finalized transaction.hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Jan 18, 2020
1 parent ada4591 commit 4b89586
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions lib/cgo/transaction.hours.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"reflect"
"unsafe"

"github.com/SkycoinProject/skycoin/src/transaction"
transaction "github.com/SkycoinProject/skycoin/src/transaction"
)

/*
Expand All @@ -12,30 +13,30 @@ import (
#include <stdlib.h>
#include "skytypes.h"
#include "skyfee.h"
#include "skyfee.h"
*/
import "C"

//export SKY_transaction_DistributeCoinHoursProportional
func SKY_transaction_DistributeCoinHoursProportional(_coins []uint64, _hours uint64, _arg2 *[]uint64) (____error_code uint32) {
coins := *(*[]uint64)(unsafe.Pointer(&_coins))
hours := _hours
__arg2, ____return_err := transaction.DistributeCoinHoursProportional(coins, hours)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
*_arg2 = __arg2
}
return
}

//export SKY_transaction_DistributeSpendHours
func SKY_transaction_DistributeSpendHours(_inputHours, _nAddrs uint64, _haveChange bool, _arg2 *uint64, _arg3 *[]uint64, _arg4 *uint64) (____error_code uint32) {
func SKY_transaction_DistributeSpendHours(_inputHours, _nAddrs uint64, _haveChange bool, _arg2 *uint64, _arg3 *C.GoSlice_, _arg4 *uint64) (____error_code uint32) {
inputHours := _inputHours
nAddrs := _nAddrs
haveChange := _haveChange
__arg2, __arg3, __arg4 := transaction.DistributeSpendHours(inputHours, nAddrs, haveChange)
*_arg2 = __arg2
*_arg3 = __arg3
copyToGoSlice(reflect.ValueOf(__arg3), _arg3)
*_arg4 = __arg4
return
}

//export SKY_transaction_DistributeCoinHoursProportional
func SKY_transaction_DistributeCoinHoursProportional(_coins []uint64, _hours uint64, _arg2 *C.GoSlice_) (____error_code uint32) {
coins := *(*[]uint64)(unsafe.Pointer(&_coins))
hours := _hours
__arg2, ____return_err := transaction.DistributeCoinHoursProportional(coins, hours)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
copyToGoSlice(reflect.ValueOf(__arg2), _arg2)
}
return
}

0 comments on commit 4b89586

Please sign in to comment.