Skip to content

Commit

Permalink
[cgo] refs fibercrypto#116 Finalized cli.add_private_key
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Jan 18, 2020
1 parent ae07666 commit 6c0d131
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/cgo/cli.add_private_key.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package main

import (
cli "github.com/SkycoinProject/skycoin/src/cli"
)
import cli "github.com/SkycoinProject/skycoin/src/cli"

/*
#include <string.h>
#include <stdlib.h>
#include "skytypes.h"
#include "skyfee.h"
*/
import "C"

//export SKY_cli_AddPrivateKey
func SKY_cli_AddPrivateKey(_wlt C.CollectionWallet__Handle, _key string) (____error_code uint32) {
wlt, okwlt := lookupCollectionWalletHandle(_wlt)
func SKY_cli_AddPrivateKey(_wlt *C.CollectionWallet__Handle, _key string) (____error_code uint32) {
wlt, okwlt := lookupCollectionWalletHandle(*_wlt)
if !okwlt {
____error_code = SKY_BAD_HANDLE
return
Expand All @@ -29,15 +28,16 @@ func SKY_cli_AddPrivateKey(_wlt C.CollectionWallet__Handle, _key string) (____er
}

//export SKY_cli_AddPrivateKeyToFile
func SKY_cli_AddPrivateKeyToFile(_walletFile, _key string, pwd C.PasswordReader__Handle) (____error_code uint32) {
func SKY_cli_AddPrivateKeyToFile(_walletFile, _key string, _pr *C.PasswordReader__Handle) (____error_code uint32) {
walletFile := _walletFile
key := _key
pr, okc := lookupPasswordReaderHandle(pwd)
if !okc {
__pr, okpr := lookupPasswordReaderHandle(*_pr)
if !okpr {
____error_code = SKY_BAD_HANDLE
return
}
____return_err := cli.AddPrivateKeyToFile(walletFile, key, *pr)
pr := *__pr
____return_err := cli.AddPrivateKeyToFile(walletFile, key, pr)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
}
Expand Down

0 comments on commit 6c0d131

Please sign in to comment.