mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-19 22:52:22 +08:00
remove pybitcoin and pybitcointools
This commit is contained in:
@@ -27,10 +27,13 @@ import traceback
|
||||
|
||||
import types
|
||||
import re
|
||||
import pybitcoin
|
||||
import socket
|
||||
from basicrpc import Proxy
|
||||
|
||||
import virtualchain
|
||||
from virtualchain.lib.hashing import hex_hash160
|
||||
|
||||
|
||||
""" this module contains the plugin to blockstack that makes the DHT useful as
|
||||
ancillary storage. This depends on the blockstack server package, since it
|
||||
includes the DHT node implementation.
|
||||
@@ -72,7 +75,7 @@ def dht_data_hash(data):
|
||||
"""
|
||||
Calculate a key from the data.
|
||||
"""
|
||||
return pybitcoin.hash.hex_hash160(data)
|
||||
return hex_hash160(data)
|
||||
|
||||
|
||||
def dht_init(local_server=False):
|
||||
@@ -161,7 +164,7 @@ def make_mutable_url(data_id):
|
||||
Return a string. Use dht+udp to convey both the scheme
|
||||
and the transport (since it won't be in /etc/services).
|
||||
"""
|
||||
return "dht+udp://" + pybitcoin.hash.hex_hash160(data_id)
|
||||
return "dht+udp://" + hex_hash160(data_id)
|
||||
|
||||
|
||||
def get_immutable_handler(key, **kw):
|
||||
@@ -259,7 +262,6 @@ if __name__ == "__main__":
|
||||
Unit tests.
|
||||
"""
|
||||
|
||||
import pybitcoin
|
||||
import json
|
||||
|
||||
# hack around absolute paths
|
||||
@@ -284,7 +286,7 @@ if __name__ == "__main__":
|
||||
print json.dumps(res)
|
||||
|
||||
def hash_data(d):
|
||||
return pybitcoin.hash.hex_hash160(d)
|
||||
return hex_hash160(d)
|
||||
|
||||
rc = storage_init({})
|
||||
if not rc:
|
||||
|
||||
@@ -309,8 +309,11 @@ if __name__ == "__main__":
|
||||
Unit tests.
|
||||
"""
|
||||
|
||||
import pybitcoin
|
||||
import keylib
|
||||
import virtualchain
|
||||
import json
|
||||
|
||||
from virtualchain.lib.hashing import *
|
||||
|
||||
# hack around absolute paths
|
||||
current_dir = os.path.abspath(os.path.join( os.path.dirname(__file__), "..") )
|
||||
@@ -319,7 +322,7 @@ if __name__ == "__main__":
|
||||
from storage import serialize_mutable_data, parse_mutable_data
|
||||
from user import make_mutable_data_info
|
||||
|
||||
pk = pybitcoin.BitcoinPrivateKey()
|
||||
pk = keylib.ECPrivateKey()
|
||||
data_privkey = pk.to_hex()
|
||||
data_pubkey = pk.public_key().to_hex()
|
||||
|
||||
@@ -331,7 +334,7 @@ if __name__ == "__main__":
|
||||
]
|
||||
|
||||
def hash_data( d ):
|
||||
return pybitcoin.hash.hex_hash160( d )
|
||||
return hex_hash160( d )
|
||||
|
||||
rc = storage_init()
|
||||
if not rc:
|
||||
|
||||
@@ -407,9 +407,11 @@ if __name__ == "__main__":
|
||||
Unit tests.
|
||||
"""
|
||||
|
||||
import pybitcoin
|
||||
import keylib
|
||||
import json
|
||||
import blockstack_client
|
||||
import virtualchain
|
||||
from virtualchain.lib.hashing import hex_hash160
|
||||
|
||||
# hack around absolute paths
|
||||
current_dir = os.path.abspath(os.path.dirname(__file__))
|
||||
@@ -427,7 +429,7 @@ if __name__ == "__main__":
|
||||
conf = get_config(CONFIG_PATH)
|
||||
print json.dumps(conf, indent=4, sort_keys=True)
|
||||
|
||||
pk = pybitcoin.BitcoinPrivateKey()
|
||||
pk = keylib.ECPrivateKey()
|
||||
data_privkey = pk.to_hex()
|
||||
data_pubkey = pk.public_key().to_hex()
|
||||
|
||||
@@ -439,7 +441,7 @@ if __name__ == "__main__":
|
||||
]
|
||||
|
||||
def hash_data( d ):
|
||||
return pybitcoin.hash.hex_hash160( d )
|
||||
return hex_hash160( d )
|
||||
|
||||
rc = storage_init(conf)
|
||||
if not rc:
|
||||
|
||||
Reference in New Issue
Block a user