Skip to content

Commit

Permalink
[libpy][test] refs skycoin#68 rename syntax 93 passed in 63.59 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevKoky committed Sep 4, 2018
1 parent 59c94e6 commit c987021
Show file tree
Hide file tree
Showing 10 changed files with 919 additions and 60 deletions.
4 changes: 3 additions & 1 deletion skycoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
import base58
import secp256k1go
import encrypt
import scrypt
import scrypt
import secp256k1
import coin
3 changes: 2 additions & 1 deletion skycoin/cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ def SHA256Xor(p0, p1, p2):
return skycoin.SKY_cipher_SHA256_Xor(p0, p1, p2)

def SHA256Null(p0):
return skycoin.SKY_cipher_SHA256_Null(p0)
return skycoin.SKY_cipher_SHA256_Null(p0)

91 changes: 91 additions & 0 deletions skycoin/coin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from .libpy import *

def CreateTransactions():
return skycoin.SKY_coin_Create_Transactions()

def TransactionsAdd(txns, txn):
return skycoin.SKY_coin_Transactions_Add(txns, txn)

def NewEmptyBlock(transactions):
return skycoin.SKY_coin_NewEmptyBlock(transactions)

def GetBlockObject(block):
return skycoin.SKY_coin_GetBlockObject(block)

def GetBlockBody(block):
return skycoin.SKY_coin_GetBlockBody(block)

def BlockBodyHash(body, bodyhash):
return skycoin.SKY_coin_BlockBody_Hash(body, bodyhash)

def NewBlock( p0, p1, p2, p3, p4):
return skycoin.SKY_coin_NewBlock( p0, p1, p2, p3, p4)

def BlockHashHeader(block, hash1):
return skycoin.SKY_coin_Block_HashHeader(block, hash1)

def BlockHeaderHash(Head, hash2):
return skycoin.SKY_coin_BlockHeader_Hash(Head, hash2)

def BlockHashBody(block, hash1):
return skycoin.SKY_coin_Block_HashBody(block, hash1)

def NewGenesisBlock(address, genCoins, genTime):
return skycoin.SKY_coin_NewGenesisBlock(address, genCoins, genTime)

def BlockHeaderBytes(head):
return skycoin.SKY_coin_BlockHeader_Bytes(head)

def TransactionPushOutput(handle, address, p0, p1):
return skycoin.SKY_coin_Transaction_PushOutput(handle, address, p0, p1)

def UxOut():
return skycoin.coin__UxOut()

def BlockHeader():
return skycoin.coin__BlockHeader()

def CreateUnspent(bh, handle, index, ux):
return skycoin.SKY_coin_CreateUnspent(bh, handle, index, ux)

def CreateUnspents(bh, txn):
return skycoin.SKY_coin_CreateUnspents(bh, txn)

def TransactionsGetAt(handle, p1):
return skycoin.SKY_coin_Transactions_GetAt(handle, p1)

def GetTransactionObject(tx1):
return skycoin.SKY_coin_GetTransactionObject(tx1)

def CreateTransaction():
return skycoin.SKY_coin_Create_Transaction()

def UxOutHash(ux, h):
return skycoin.SKY_coin_UxOut_Hash(ux, h)

def TransactionPushInput(handle, h):
return skycoin.SKY_coin_Transaction_PushInput(handle, h)

def TransactionSignInputs(handle, secKeys):
return skycoin.SKY_coin_Transaction_SignInputs(handle, secKeys)

def TransactionUpdateHeader(handle):
return skycoin.SKY_coin_Transaction_UpdateHeader(handle)

def UxBody():
return skycoin.coin__UxBody()

def UxHead():
return skycoin.coin__UxHead()

def Transaction():
return skycoin.coin__Transaction()

def TransactionsLength(handle):
return skycoin.SKY_coin_Transactions_Length(handle)

def TransactionCopy(handle):
return skycoin.SKY_coin_Transaction_Copy(handle)

def TransactionVerify(handle2):
return skycoin.coin_Transaction_Verify(handle2)
40 changes: 40 additions & 0 deletions skycoin/secp256k1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from .libpy import *

def UncompressedPubkeyFromSeckey(privkey):
return skycoin.SKY_secp256k1_UncompressedPubkeyFromSeckey(privkey)

def GenerateKeyPair():
return skycoin.SKY_secp256k1_GenerateKeyPair()

def Sign(msg, seckey):
return skycoin.SKY_secp256k1_Sign(msg, seckey)

def VerifyPubkey(pub_key):
return skycoin.SKY_secp256k1_VerifyPubkey(pub_key)

def RecoverPubkey(msg, sig):
return skycoin.SKY_secp256k1_RecoverPubkey(msg, sig)

def VerifySeckey(sec_key):
return skycoin.SKY_secp256k1_VerifySeckey(sec_key)

def VerifySignature(hashs, sig, pub_key):
return skycoin.SKY_secp256k1_VerifySignature(hashs, sig, pub_key)

def RandByte(num):
return skycoin.SKY_secp256k1_RandByte(num)

def DeterministicKeyPairIterator(seed):
return skycoin.SKY_secp256k1_DeterministicKeyPairIterator(seed)

def GenerateDeterministicKeyPair(seed):
return skycoin.SKY_secp256k1_GenerateDeterministicKeyPair(seed)

def Secp256k1Hash(_hash):
return skycoin.SKY_secp256k1_Secp256k1Hash(_hash)

def ECDH(pub_key, sec_key):
return skycoin.SKY_secp256k1_ECDH(pub_key, sec_key)

def PubkeyFromSeckey(sec_key):
return skycoin.SKY_secp256k1_PubkeyFromSeckey(sec_key)
33 changes: 31 additions & 2 deletions skycoin/secp256k1go.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# import skycoin
from .libpy import *

def NumberCreate():
Expand Down Expand Up @@ -32,4 +31,34 @@ def FieldEquals(p0, p1):
return skycoin.SKY_secp256k1go_Field_Equals(p0, p1)

def FieldInv(in_, out):
return skycoin.SKY_secp256k1go_Field_Inv(in_, out)
return skycoin.SKY_secp256k1go_Field_Inv(in_, out)

def XYZDouble(a, r):
return skycoin.SKY_secp256k1go_XYZ_Double(a, r)

def XY():
return skycoin.secp256k1go__XY()

def SignatureCreate():
return skycoin.SKY_secp256k1go_Signature_Create()

def SignatureGetR(sig):
return skycoin.SKY_secp256k1go_Signature_GetR(sig)

def SignatureRecover(sig, public_key, msg, rid):
return skycoin.SKY_secp256k1go_Signature_Recover(sig, public_key, msg, rid)

def SignatureGetS(sig):
return skycoin.SKY_secp256k1go_Signature_GetS(sig)

def SignatureVerify(sig, key, msg):
return skycoin.SKY_secp256k1go_Signature_Verify(sig, key, msg)

def XYParsePubkey(key, xy):
return skycoin.SKY_secp256k1go_XY_ParsePubkey(key, xy)

def SignatureSign(sig, sec, msg, non):
return skycoin.SKY_secp256k1go_Signature_Sign(sig, sec, msg, non)

def NumberIsEqual(r, non):
return skycoin.SKY_secp256k1go_Number_IsEqual(r, non)
Loading

0 comments on commit c987021

Please sign in to comment.