Fix decodeAddress without bech32 hrp
This commit is contained in:
		
							parent
							
								
									54e434e1c9
								
							
						
					
					
						commit
						8ec6d55963
					
				| @ -7,6 +7,7 @@ | |||||||
| 
 | 
 | ||||||
| from .btc import BTCInterface | from .btc import BTCInterface | ||||||
| from basicswap.chainparams import Coins | from basicswap.chainparams import Coins | ||||||
|  | from basicswap.util.address import decodeAddress | ||||||
| from mnemonic import Mnemonic | from mnemonic import Mnemonic | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -22,6 +23,9 @@ class DASHInterface(BTCInterface): | |||||||
|         words = self.seedToMnemonic(key) |         words = self.seedToMnemonic(key) | ||||||
|         self.rpc_callback('upgradetohd', [words, ]) |         self.rpc_callback('upgradetohd', [words, ]) | ||||||
| 
 | 
 | ||||||
|  |     def decodeAddress(self, address): | ||||||
|  |         return decodeAddress(address)[1:] | ||||||
|  | 
 | ||||||
|     def checkExpectedSeed(self, key_hash): |     def checkExpectedSeed(self, key_hash): | ||||||
|         try: |         try: | ||||||
|             rv = self.rpc_callback('dumphdinfo') |             rv = self.rpc_callback('dumphdinfo') | ||||||
|  | |||||||
| @ -9,9 +9,7 @@ import hashlib | |||||||
| from .btc import BTCInterface, find_vout_for_address_from_txobj | from .btc import BTCInterface, find_vout_for_address_from_txobj | ||||||
| from basicswap.chainparams import Coins | from basicswap.chainparams import Coins | ||||||
| 
 | 
 | ||||||
| from basicswap.util.address import ( | from basicswap.util.address import decodeAddress | ||||||
|     decodeAddress, |  | ||||||
| ) |  | ||||||
| from basicswap.contrib.test_framework.script import ( | from basicswap.contrib.test_framework.script import ( | ||||||
|     CScript, |     CScript, | ||||||
|     OP_0, |     OP_0, | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ | |||||||
| 
 | 
 | ||||||
| from .btc import BTCInterface | from .btc import BTCInterface | ||||||
| from basicswap.chainparams import Coins | from basicswap.chainparams import Coins | ||||||
|  | from basicswap.util.address import decodeAddress | ||||||
| from .contrib.pivx_test_framework.messages import ( | from .contrib.pivx_test_framework.messages import ( | ||||||
|     CBlock, |     CBlock, | ||||||
|     ToHex, |     ToHex, | ||||||
| @ -32,6 +33,9 @@ class PIVXInterface(BTCInterface): | |||||||
|         txn_signed = self.rpc_callback('signrawtransaction', [txn_funded])['hex'] |         txn_signed = self.rpc_callback('signrawtransaction', [txn_funded])['hex'] | ||||||
|         return txn_signed |         return txn_signed | ||||||
| 
 | 
 | ||||||
|  |     def decodeAddress(self, address): | ||||||
|  |         return decodeAddress(address)[1:] | ||||||
|  | 
 | ||||||
|     def getBlockWithTxns(self, block_hash): |     def getBlockWithTxns(self, block_hash): | ||||||
|         # TODO: Bypass decoderawtransaction and getblockheader |         # TODO: Bypass decoderawtransaction and getblockheader | ||||||
|         block = self.rpc_callback('getblock', [block_hash, False]) |         block = self.rpc_callback('getblock', [block_hash, False]) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user