Skip to content

Commit

Permalink
[libpy][test] refs skycoin#68 add namespace structure 18 passed in 13…
Browse files Browse the repository at this point in the history
….01 seconds
  • Loading branch information
stdevKoky committed Sep 3, 2018
1 parent 408c083 commit 9a617d2
Show file tree
Hide file tree
Showing 11 changed files with 14,617 additions and 11,235 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ build-swig:
sed -i 's/#/%/g' $(LIBSWIG_DIR)/structs.i ;\
fi \
}
rm -f ./skycoin/skycoin.py
rm -f ./skycoin/libpy/skycoin.py
rm -f swig/pyskycoin_wrap.c
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/skycoin.i
mkdir -p ./skycoin/libpy/
touch ./skycoin/libpy/__init__.py
swig -python -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/libpy/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/skycoin.i

develop:
$(PYTHON_BIN) setup.py develop
Expand Down
6 changes: 4 additions & 2 deletions skycoin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .skycoin import *
from .skyerror import *
from .skyerror import *
import cipher
import base58
import secp256k1go
8 changes: 8 additions & 0 deletions skycoin/base58.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# import skycoin
from .libpy import *

def String2Hex(cadena):
return skycoin.SKY_base58_String2Hex(cadena)

def Hex2Base58(cadena):
return skycoin.SKY_base58_Hex2Base58(cadena)
86 changes: 86 additions & 0 deletions skycoin/cipher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# from .libpy import *
from libpy import skycoin

def PubKey():
return skycoin.cipher_PubKey()

def SecKey():
return skycoin.cipher_SecKey()

def Address():
return skycoin.cipher__Address()

def AddressFromPubKey(public_key, addres):
return skycoin.SKY_cipher_AddressFromPubKey(public_key, addres)

def NewPubKey(hex_str, public_key):
return skycoin.SKY_cipher_NewPubKey(hex_str, public_key)

def NewSecKey(hex_str, secret_key):
return skycoin.SKY_cipher_NewSecKey(hex_str, secret_key)

def PubKeyFromSecKey(secret_key, public_key):
return skycoin.SKY_cipher_PubKeyFromSecKey(secret_key, public_key)

def GenerateKeyPair(public_key, secret_key):
return skycoin.SKY_cipher_GenerateKeyPair(public_key, secret_key)

def TestSecKey(secret_key):
return skycoin.SKY_cipher_TestSecKey(secret_key)

def SHA256():
return skycoin.cipher_SHA256()

def SumSHA256(text, sha):
return skycoin.SKY_cipher_SumSHA256(text, sha)

def TestSecKeyHash(secret_key, sha):
return skycoin.SKY_cipher_TestSecKeyHash(secret_key, sha)

def AddressVerify(address, public_key):
return skycoin.SKY_cipher_Address_Verify(address, public_key)

def DecodeBase58Address(cadena, address):
return skycoin.SKY_cipher_DecodeBase58Address(cadena, address)

def AddressBytes(address):
return skycoin.SKY_cipher_Address_Bytes(address)

def AddressString(address):
return skycoin.SKY_cipher_Address_String(address)

def AddressFromBytes(byte, address):
return skycoin.SKY_cipher_AddressFromBytes(byte, address)

def AddressBitcoinBytes(address):
return skycoin.SKY_cipher_Address_BitcoinBytes(address)

def BitcoinAddressFromBytes(byte, address):
return skycoin.SKY_cipher_BitcoinAddressFromBytes(byte, address)

def PubKeyHex(public_key):
return skycoin.SKY_cipher_PubKey_Hex(public_key)

def BitcoinAddressFromPubkey(public_key):
return skycoin.SKY_cipher_BitcoinAddressFromPubkey(public_key)

def SecKeyFromHex(cadena, secret_key):
return skycoin.SKY_cipher_SecKeyFromHex(cadena, secret_key)

def BitcoinWalletImportFormatFromSeckey(secret_key):
return skycoin.SKY_cipher_BitcoinWalletImportFormatFromSeckey(secret_key)

def SecKeyFromWalletImportFormat(wip_1, secret_key):
return skycoin.SKY_cipher_SecKeyFromWalletImportFormat(wip_1, secret_key)

def SecKeyHex(secret_key):
return skycoin.SKY_cipher_SecKey_Hex(secret_key)

def RandByte(rang):
return skycoin.SKY_cipher_RandByte(rang)

def GenerateDeterministicKeyPair(data, public_key, secret_key):
return skycoin.SKY_cipher_GenerateDeterministicKeyPair(data, public_key, secret_key)

def AddressNull(address):
return skycoin.SKY_cipher_Address_Null(address)
Empty file added skycoin/libpy/__init__.py
Empty file.
Loading

0 comments on commit 9a617d2

Please sign in to comment.