Skip to content

Commit

Permalink
[cgo] refs fibercrypto#116 Clean old definitions in libsky_handle.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Jan 27, 2020
1 parent 64c0c8a commit 190d33d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
5 changes: 3 additions & 2 deletions lib/cgo/cli.generate_addrs.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package main

import (
cipher "github.com/SkycoinProject/skycoin/src/cipher"
cli "github.com/SkycoinProject/skycoin/src/cli"
"reflect"
"unsafe"

cipher "github.com/SkycoinProject/skycoin/src/cipher"
cli "github.com/SkycoinProject/skycoin/src/cli"
)

/*
Expand Down
15 changes: 14 additions & 1 deletion lib/cgo/libsky_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ var (
func registerHandle(obj interface{}) C.Handle {
handlesCounter++
handle := handlesCounter
//handle := *(*Handle)(unsafe.Pointer(&obj))
handleMap[Handle(handle)] = obj
return (C.Handle)(handle)
}
Expand Down Expand Up @@ -689,3 +688,17 @@ func lookupUnspentOutputsSummaryHandle(handle C.UnspentOutputsSummary__Handle) (
}
return nil, false
}

func registerAddressUxOutsHandle(obj *coin.AddressUxOuts) C.AddressUxOuts__Handle {
return (C.AddressUxOuts__Handle)(registerHandle(obj))
}

func lookupAddressUxOutsHandle(handle C.AddressUxOuts__Handle) (*coin.AddressUxOuts, bool) {
obj, ok := lookupHandle(C.Handle(handle))
if ok {
if obj, isOK := (obj).(*coin.AddressUxOuts); isOK {
return obj, true
}
}
return nil, false
}
14 changes: 0 additions & 14 deletions lib/cgo/transaction.choose.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,3 @@ func SKY_transaction_ChooseSpendsMaximizeUxOuts(_uxa []C.transaction__UxBalance,
}
return
}

//export SKY_transaction_ChooseSpends
func SKY_transaction_ChooseSpends(_uxa []C.transaction__UxBalance, _coins, _hours uint64, _sortStrategy, _arg3 *C.GoSlice_) (____error_code uint32) {
uxa := *(*[]transaction.UxBalance)(unsafe.Pointer(&_uxa))
coins := _coins
hours := _hours
sortStrategy := copyToFunc(_sortStrategy)
__arg3, ____return_err := transaction.ChooseSpends(uxa, coins, hours, sortStrategy)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
copyToGoSlice(reflect.ValueOf(__arg3), _arg3)
}
return
}

0 comments on commit 190d33d

Please sign in to comment.