Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development' into feature-dynamic-invoke
Browse files Browse the repository at this point in the history
  • Loading branch information
localhuman committed Dec 3, 2017
2 parents bb01887 + 2c00bc8 commit d0a6898
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
3 changes: 3 additions & 0 deletions neo/Fixed8.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def __ge__(self, other):
def __le__(self, other):
return self.value <= other.value

def ToInt(self):
return int(self.value / Fixed8.D)

def ToString(self):
return self.value / Fixed8.D
# def __str__(self):
Expand Down
2 changes: 1 addition & 1 deletion neo/Wallets/Wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def ContainsKey(self, public_key):
Returns:
bool: True if exists, False otherwise.
"""
return self.ContainsKeyHash(Crypto.ToScriptHash(public_key.encode_point(True), unhex=False))
return self.ContainsKeyHash(Crypto.ToScriptHash(public_key.encode_point(True), unhex=True))

def ContainsKeyHash(self, public_key_hash):
"""
Expand Down
14 changes: 14 additions & 0 deletions neo/Wallets/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from neo.Cryptography.Crypto import Crypto
import hashlib

from neo.Wallets.Wallet import Wallet


class WalletTestCase(NeoTestCase):

Expand Down Expand Up @@ -102,3 +104,15 @@ def test_neon_sig(self):
sig = Crypto.Sign(self.nmsg, key.PrivateKey, key.PublicKey)

self.assertEqual(sig.hex(), self.neon_sig)

def test_get_contains_key_should_be_found(self):
wallet = Wallet("fakepath", "123", True)
wallet.CreateKey()
keypair = wallet.GetKeys()[0]
self.assertTrue(wallet.ContainsKey(keypair.PublicKey))

def test_get_contains_key_should_not_be_found(self):
wallet = Wallet("fakepath", "123", True)
wallet.CreateKey()
keypair = KeyPair(priv_key=self.pk)
self.assertFalse(wallet.ContainsKey(keypair.PublicKey))
1 change: 1 addition & 0 deletions prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class PromptInterface(object):
'config debug {on/off}',
'config sc-events {on/off}',
'build {path/to/file.py} (test {params} {returntype} {needs_storage} {test_params})',
'load_run {path/to/file.avm} (test {params} {returntype} {needs_storage} {test_params})',
'import wif {wif}',
'import nep2 {nep2_encrypted_key}',
'import contract {path/to/file.avm} {params} {returntype} {needs_storage}',
Expand Down
41 changes: 41 additions & 0 deletions protocol.coz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"ProtocolConfiguration": {
"Magic": 1010102,
"AddressVersion": 23,
"StandbyValidators": [
"032d9e51c7d48b0f5cc63d63deb89767685832cf69eb7113900290f217ae0504ee",
"022a5b7ccf03166a95e1750f0c350c734c34fe7aac66622eecdb5a529d2e69b1df",
"03c478d43271c297696ee3ab5a7946ee60287015c7dca6cba867819c7f271bc4ea",
"0393ef777d01fb60eef1da3474b975c6a393b464bcfe588e2ad7dbc4dbdfa2c244"
],
"SeedList": [
"188.68.34.29:10330",
"188.68.34.29:10332",
"188.68.34.29:10334",
"188.68.34.29:10336"
],
"RPCList":[
"http://188.68.34.29:10001",
"http://188.68.34.29:10002",
"http://188.68.34.29:10003",
"http://188.68.34.29:10004"
],
"SystemFee": {
"EnrollmentTransaction": 1000,
"IssueTransaction": 500,
"PublishTransaction": 500,
"RegisterTransaction": 10000
}
},

"ApplicationConfiguration": {
"DataDirectoryPath": "./Chains/coznet",
"NodePort": 20333,
"WsPort": 20334,
"UriPrefix": [ "http://*:20332"],
"SslCert": "",
"SslCertPassword": "",
"VersionName":"/NEO-PYTHON:2.3.4/",
"BootstrapFile":""
}
}

0 comments on commit d0a6898

Please sign in to comment.