mirror of
https://github.com/basicswap/basicswap.git
synced 2025-01-05 18:29:26 +00:00
coins: Raise Litecoin version to 0.21.2
This commit is contained in:
parent
844db9c541
commit
b64437db84
5 changed files with 32 additions and 7 deletions
|
@ -496,6 +496,7 @@ class BasicSwap(BaseApp):
|
||||||
pidfilename = cc['name']
|
pidfilename = cc['name']
|
||||||
if cc['name'] == 'bitcoin' or cc['name'] == 'litecoin' or cc['name'] == 'namecoin':
|
if cc['name'] == 'bitcoin' or cc['name'] == 'litecoin' or cc['name'] == 'namecoin':
|
||||||
pidfilename += 'd'
|
pidfilename += 'd'
|
||||||
|
|
||||||
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
pidfilepath = os.path.join(self.getChainDatadirPath(coin), pidfilename + '.pid')
|
||||||
self.log.debug('Reading %s rpc credentials from auth cookie %s', coin, authcookiepath)
|
self.log.debug('Reading %s rpc credentials from auth cookie %s', coin, authcookiepath)
|
||||||
# Wait for daemon to start
|
# Wait for daemon to start
|
||||||
|
@ -503,6 +504,12 @@ class BasicSwap(BaseApp):
|
||||||
datadir_pid = -1
|
datadir_pid = -1
|
||||||
for i in range(20):
|
for i in range(20):
|
||||||
try:
|
try:
|
||||||
|
# Workaround for mismatched pid file name in litecoin 0.21.2
|
||||||
|
# TODO: Remove
|
||||||
|
if cc['name'] == 'litecoin' and not os.path.exists(pidfilepath) and \
|
||||||
|
os.path.exists(os.path.join(self.getChainDatadirPath(coin), 'bitcoind.pid')):
|
||||||
|
pidfilepath = os.path.join(self.getChainDatadirPath(coin), 'bitcoind.pid')
|
||||||
|
|
||||||
with open(pidfilepath, 'rb') as fp:
|
with open(pidfilepath, 'rb') as fp:
|
||||||
datadir_pid = int(fp.read().decode('utf-8'))
|
datadir_pid = int(fp.read().decode('utf-8'))
|
||||||
assert(datadir_pid == cc['pid']), 'Mismatched pid'
|
assert(datadir_pid == cc['pid']), 'Mismatched pid'
|
||||||
|
|
|
@ -116,7 +116,8 @@ chainparams = {
|
||||||
'mainnet': {
|
'mainnet': {
|
||||||
'rpcport': 9332,
|
'rpcport': 9332,
|
||||||
'pubkey_address': 48,
|
'pubkey_address': 48,
|
||||||
'script_address': 50,
|
'script_address': 5,
|
||||||
|
'script_address2': 50,
|
||||||
'key_prefix': 176,
|
'key_prefix': 176,
|
||||||
'hrp': 'ltc',
|
'hrp': 'ltc',
|
||||||
'bip44': 2,
|
'bip44': 2,
|
||||||
|
@ -126,7 +127,8 @@ chainparams = {
|
||||||
'testnet': {
|
'testnet': {
|
||||||
'rpcport': 19332,
|
'rpcport': 19332,
|
||||||
'pubkey_address': 111,
|
'pubkey_address': 111,
|
||||||
'script_address': 58,
|
'script_address': 196,
|
||||||
|
'script_address2': 58,
|
||||||
'key_prefix': 239,
|
'key_prefix': 239,
|
||||||
'hrp': 'tltc',
|
'hrp': 'tltc',
|
||||||
'bip44': 1,
|
'bip44': 1,
|
||||||
|
@ -137,7 +139,8 @@ chainparams = {
|
||||||
'regtest': {
|
'regtest': {
|
||||||
'rpcport': 19443,
|
'rpcport': 19443,
|
||||||
'pubkey_address': 111,
|
'pubkey_address': 111,
|
||||||
'script_address': 58,
|
'script_address': 196,
|
||||||
|
'script_address2': 58,
|
||||||
'key_prefix': 239,
|
'key_prefix': 239,
|
||||||
'hrp': 'rltc',
|
'hrp': 'rltc',
|
||||||
'bip44': 1,
|
'bip44': 1,
|
||||||
|
|
|
@ -40,7 +40,7 @@ PARTICL_VERSION = os.getenv('PARTICL_VERSION', '0.21.2.9')
|
||||||
PARTICL_VERSION_TAG = os.getenv('PARTICL_VERSION_TAG', '')
|
PARTICL_VERSION_TAG = os.getenv('PARTICL_VERSION_TAG', '')
|
||||||
PARTICL_LINUX_EXTRA = os.getenv('PARTICL_LINUX_EXTRA', '_nousb')
|
PARTICL_LINUX_EXTRA = os.getenv('PARTICL_LINUX_EXTRA', '_nousb')
|
||||||
|
|
||||||
LITECOIN_VERSION = os.getenv('LITECOIN_VERSION', '0.18.1')
|
LITECOIN_VERSION = os.getenv('LITECOIN_VERSION', '0.21.2')
|
||||||
LITECOIN_VERSION_TAG = os.getenv('LITECOIN_VERSION_TAG', '')
|
LITECOIN_VERSION_TAG = os.getenv('LITECOIN_VERSION_TAG', '')
|
||||||
|
|
||||||
BITCOIN_VERSION = os.getenv('BITCOIN_VERSION', '22.0')
|
BITCOIN_VERSION = os.getenv('BITCOIN_VERSION', '22.0')
|
||||||
|
@ -52,7 +52,7 @@ MONERO_VERSION_TAG = os.getenv('MONERO_VERSION_TAG', '')
|
||||||
# version, version tag eg. "rc1", signers
|
# version, version tag eg. "rc1", signers
|
||||||
known_coins = {
|
known_coins = {
|
||||||
'particl': (PARTICL_VERSION, PARTICL_VERSION_TAG, ('tecnovert',)),
|
'particl': (PARTICL_VERSION, PARTICL_VERSION_TAG, ('tecnovert',)),
|
||||||
'litecoin': (LITECOIN_VERSION, LITECOIN_VERSION_TAG, ('thrasher',)),
|
'litecoin': (LITECOIN_VERSION, LITECOIN_VERSION_TAG, ('davidburkett38',)),
|
||||||
'bitcoin': (BITCOIN_VERSION, BITCOIN_VERSION_TAG, ('laanwj',)),
|
'bitcoin': (BITCOIN_VERSION, BITCOIN_VERSION_TAG, ('laanwj',)),
|
||||||
'namecoin': ('0.18.0', '', ('JeremyRand',)),
|
'namecoin': ('0.18.0', '', ('JeremyRand',)),
|
||||||
'monero': (MONERO_VERSION, MONERO_VERSION_TAG, ('binaryfate',)),
|
'monero': (MONERO_VERSION, MONERO_VERSION_TAG, ('binaryfate',)),
|
||||||
|
@ -64,6 +64,7 @@ expected_key_ids = {
|
||||||
'laanwj': ('1E4AED62986CD25D',),
|
'laanwj': ('1E4AED62986CD25D',),
|
||||||
'JeremyRand': ('2DBE339E29F6294C',),
|
'JeremyRand': ('2DBE339E29F6294C',),
|
||||||
'binaryfate': ('F0AF4D462A0BDF92',),
|
'binaryfate': ('F0AF4D462A0BDF92',),
|
||||||
|
'davidburkett38': ('3620E9D387E55666',),
|
||||||
}
|
}
|
||||||
|
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin':
|
||||||
|
@ -327,7 +328,7 @@ def prepareCore(coin, version_data, settings, data_dir, extra_opts={}):
|
||||||
assert_url = 'https://raw.githubusercontent.com/particl/gitian.sigs/master/%s-%s/%s/%s' % (version + version_tag, os_dir_name, signing_key_name, assert_filename)
|
assert_url = 'https://raw.githubusercontent.com/particl/gitian.sigs/master/%s-%s/%s/%s' % (version + version_tag, os_dir_name, signing_key_name, assert_filename)
|
||||||
elif coin == 'litecoin':
|
elif coin == 'litecoin':
|
||||||
release_url = 'https://download.litecoin.org/litecoin-{}/{}/{}'.format(version, os_name, release_filename)
|
release_url = 'https://download.litecoin.org/litecoin-{}/{}/{}'.format(version, os_name, release_filename)
|
||||||
assert_filename = '{}-{}-{}-build.assert'.format(coin, os_name, version.rsplit('.', 1)[0])
|
assert_filename = '{}-core-{}-{}-build.assert'.format(coin, os_name, version.rsplit('.', 1)[0])
|
||||||
assert_url = 'https://raw.githubusercontent.com/litecoin-project/gitian.sigs.ltc/master/%s-%s/%s/%s' % (version, os_dir_name, signing_key_name, assert_filename)
|
assert_url = 'https://raw.githubusercontent.com/litecoin-project/gitian.sigs.ltc/master/%s-%s/%s/%s' % (version, os_dir_name, signing_key_name, assert_filename)
|
||||||
elif coin == 'bitcoin':
|
elif coin == 'bitcoin':
|
||||||
release_url = 'https://bitcoincore.org/bin/bitcoin-core-{}/{}'.format(version, release_filename)
|
release_url = 'https://bitcoincore.org/bin/bitcoin-core-{}/{}'.format(version, release_filename)
|
||||||
|
|
|
@ -22,6 +22,7 @@ from coincurve.keys import (
|
||||||
PrivateKey)
|
PrivateKey)
|
||||||
|
|
||||||
from basicswap.util import i2b, h2b
|
from basicswap.util import i2b, h2b
|
||||||
|
from basicswap.util.crypto import ripemd160
|
||||||
from basicswap.util.rfc2440 import rfc2440_hash_password
|
from basicswap.util.rfc2440 import rfc2440_hash_password
|
||||||
from basicswap.interface_btc import BTCInterface
|
from basicswap.interface_btc import BTCInterface
|
||||||
from basicswap.interface_xmr import XMRInterface
|
from basicswap.interface_xmr import XMRInterface
|
||||||
|
@ -287,6 +288,10 @@ class Test(unittest.TestCase):
|
||||||
|
|
||||||
assert(password_hash == '16:B7A94A7E4988630E6095334BA67F06FBA509B2A7136A04C9C1B430F539')
|
assert(password_hash == '16:B7A94A7E4988630E6095334BA67F06FBA509B2A7136A04C9C1B430F539')
|
||||||
|
|
||||||
|
def test_ripemd160(self):
|
||||||
|
input_data = b'hash this'
|
||||||
|
assert(ripemd160(input_data).hex() == 'd5443a154f167e2c1332f6de72cfb4c6ab9c8c17')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -456,11 +456,20 @@ class BaseTest(unittest.TestCase):
|
||||||
logging.info('Mining %d Litecoin blocks to %s', num_blocks, cls.ltc_addr)
|
logging.info('Mining %d Litecoin blocks to %s', num_blocks, cls.ltc_addr)
|
||||||
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.ltc_addr], base_rpc_port=LTC_BASE_RPC_PORT)
|
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.ltc_addr], base_rpc_port=LTC_BASE_RPC_PORT)
|
||||||
|
|
||||||
num_blocks = 100
|
num_blocks = 31
|
||||||
cls.ltc_addr = cls.swap_clients[0].ci(Coins.LTC).pubkey_to_address(void_block_rewards_pubkey)
|
cls.ltc_addr = cls.swap_clients[0].ci(Coins.LTC).pubkey_to_address(void_block_rewards_pubkey)
|
||||||
logging.info('Mining %d Litecoin blocks to %s', num_blocks, cls.ltc_addr)
|
logging.info('Mining %d Litecoin blocks to %s', num_blocks, cls.ltc_addr)
|
||||||
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.ltc_addr], base_rpc_port=LTC_BASE_RPC_PORT)
|
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.ltc_addr], base_rpc_port=LTC_BASE_RPC_PORT)
|
||||||
|
|
||||||
|
# https://github.com/litecoin-project/litecoin/issues/807
|
||||||
|
# Block 432 is when MWEB activates. It requires a peg-in. You'll need to generate an mweb address and send some coins to it. Then it will allow you to mine the next block.
|
||||||
|
mweb_addr = callnoderpc(2, 'getnewaddress', ['mweb_addr', 'mweb'], base_rpc_port=LTC_BASE_RPC_PORT)
|
||||||
|
callnoderpc(0, 'sendtoaddress', [mweb_addr, 1], base_rpc_port=LTC_BASE_RPC_PORT)
|
||||||
|
|
||||||
|
num_blocks = 69
|
||||||
|
cls.ltc_addr = cls.swap_clients[0].ci(Coins.LTC).pubkey_to_address(void_block_rewards_pubkey)
|
||||||
|
callnoderpc(0, 'generatetoaddress', [num_blocks, cls.ltc_addr], base_rpc_port=LTC_BASE_RPC_PORT)
|
||||||
|
|
||||||
checkForks(callnoderpc(0, 'getblockchaininfo', base_rpc_port=LTC_BASE_RPC_PORT))
|
checkForks(callnoderpc(0, 'getblockchaininfo', base_rpc_port=LTC_BASE_RPC_PORT))
|
||||||
|
|
||||||
num_blocks = 100
|
num_blocks = 100
|
||||||
|
|
Loading…
Reference in a new issue