Skip to content

Commit

Permalink
[cgo] refs skycoin#105 - Removed function SKY_api_Handle_GetWalletMeta
Browse files Browse the repository at this point in the history
- Removed function `SKY_api_Handle_GetWalletEntriesCount`
- Removed function `SKY_api_Handle_WalletGetEntry`
- Removed function `SKY_api_Handle_WalletResponseGetCryptoType`
  • Loading branch information
Maykel Arias Torres committed Aug 10, 2019
1 parent 6809e53 commit f0d8a1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 57 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Removed function `SKY_wallet_ReadableWallet_Save`
- Removed function `SKY_wallet_ReadableWallet_Load`
- Removed function `SKY_wallet_ReadableWallet_Erase`
- Removed function `SKY_api_Handle_GetWalletMeta`
- Removed function `SKY_api_Handle_GetWalletEntriesCount`
- Removed function `SKY_api_Handle_WalletGetEntry`
- Removed function `SKY_api_Handle_WalletResponseGetCryptoType`

### Changed

Expand Down
63 changes: 6 additions & 57 deletions lib/cgo/libsky_handle_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"encoding/json"
"path/filepath"
"sort"
"unsafe"

api "github.com/skycoin/skycoin/src/api"
"github.com/skycoin/skycoin/src/daemon"
Expand Down Expand Up @@ -216,28 +215,6 @@ func SKY_api_Handle_Client_GetWalletFullPath(
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_GetWalletMeta
func SKY_api_Handle_GetWalletMeta(handle C.Wallet__Handle,
gomap *C.GoStringMap_) uint32 {
w, ok := lookupWalletHandle(handle)
if ok {
copyToStringMap(w.Meta, gomap)
return SKY_OK
}
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_GetWalletEntriesCount
func SKY_api_Handle_GetWalletEntriesCount(handle C.Wallet__Handle,
count *uint32) uint32 {
w, ok := lookupWalletHandle(handle)
if ok {
*count = uint32(len(w.Entries))
return SKY_OK
}
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_Client_GetWalletResponseEntriesCount
func SKY_api_Handle_Client_GetWalletResponseEntriesCount(
handle C.WalletResponse__Handle,
Expand All @@ -250,22 +227,6 @@ func SKY_api_Handle_Client_GetWalletResponseEntriesCount(
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_WalletGetEntry
func SKY_api_Handle_WalletGetEntry(handle C.Wallet__Handle,
index uint32,
address *C.cipher__Address,
pubkey *C.cipher__PubKey) uint32 {
w, ok := lookupWalletHandle(handle)
if ok {
if index < uint32(len(w.Entries)) {
*address = *(*C.cipher__Address)(unsafe.Pointer(&w.Entries[index].Address))
*pubkey = *(*C.cipher__PubKey)(unsafe.Pointer(&w.Entries[index].Public))
return SKY_OK
}
}
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_WalletResponseGetEntry
func SKY_api_Handle_WalletResponseGetEntry(handle C.WalletResponse__Handle,
index uint32,
Expand Down Expand Up @@ -294,18 +255,6 @@ func SKY_api_Handle_WalletResponseIsEncrypted(
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_WalletResponseGetCryptoType
func SKY_api_Handle_WalletResponseGetCryptoType(
handle C.WalletResponse__Handle,
cryptoType *C.GoString_) uint32 {
w, ok := lookupWalletResponseHandle(handle)
if ok {
copyString(w.Meta.CryptoType, cryptoType)
return SKY_OK
}
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_WalletsResponseGetCount
func SKY_api_Handle_WalletsResponseGetCount(
handle C.Wallets__Handle,
Expand Down Expand Up @@ -348,22 +297,22 @@ func SKY_api_Handle_GetWalletFolderAddress(
}

//export SKY_api_Handle_GetWalletSeed
func SKY_api_Handle_GetWalletSeed(handle C.Wallet__Handle,
func SKY_api_Handle_GetWalletSeed(handle C.MetaWallet__Handle,
seed *C.GoString_) uint32 {
w, ok := lookupWalletHandle(handle)
w, ok := lookupMetaWalletHandle(handle)
if ok {
copyString(w.Meta["seed"], seed)
copyString(w.Seed(), seed)
return SKY_OK
}
return SKY_BAD_HANDLE
}

//export SKY_api_Handle_GetWalletLastSeed
func SKY_api_Handle_GetWalletLastSeed(handle C.Wallet__Handle,
func SKY_api_Handle_GetWalletLastSeed(handle C.MetaWallet__Handle,
lastSeed *C.GoString_) uint32 {
w, ok := lookupWalletHandle(handle)
w, ok := lookupMetaWalletHandle(handle)
if ok {
copyString(w.Meta["lastSeed"], lastSeed)
copyString(w.LastSeed(), lastSeed)
return SKY_OK
}
return SKY_BAD_HANDLE
Expand Down

0 comments on commit f0d8a1e

Please sign in to comment.