coins: Raise Litecoin version to 0.21.2

This commit is contained in:
tecnovert
2022-06-16 15:37:32 +02:00
parent 844db9c541
commit b64437db84
5 changed files with 32 additions and 7 deletions

View File

@@ -22,6 +22,7 @@ from coincurve.keys import (
PrivateKey)
from basicswap.util import i2b, h2b
from basicswap.util.crypto import ripemd160
from basicswap.util.rfc2440 import rfc2440_hash_password
from basicswap.interface_btc import BTCInterface
from basicswap.interface_xmr import XMRInterface
@@ -287,6 +288,10 @@ class Test(unittest.TestCase):
assert(password_hash == '16:B7A94A7E4988630E6095334BA67F06FBA509B2A7136A04C9C1B430F539')
def test_ripemd160(self):
input_data = b'hash this'
assert(ripemd160(input_data).hex() == 'd5443a154f167e2c1332f6de72cfb4c6ab9c8c17')
if __name__ == '__main__':
unittest.main()

View File

@@ -456,11 +456,20 @@ class BaseTest(unittest.TestCase):
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)
num_blocks = 100
num_blocks = 31
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)
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))
num_blocks = 100