mirror of
https://github.com/basicswap/basicswap.git
synced 2026-03-02 01:15:10 +01:00
refactor: Remove encodeSegwitP2WSH and getScriptAddress
This commit is contained in:
@@ -17,7 +17,6 @@ from .rpc import (
|
||||
)
|
||||
from .util import (
|
||||
TemporaryError,
|
||||
pubkeyToAddress,
|
||||
)
|
||||
from .chainparams import (
|
||||
Coins,
|
||||
@@ -95,18 +94,12 @@ class BaseApp:
|
||||
return c
|
||||
raise ValueError('Unknown coin: {}'.format(coin_name))
|
||||
|
||||
def encodeSegwitP2WSH(self, coin_type, p2wsh):
|
||||
return segwit_addr.encode(chainparams[coin_type][self.chain]['hrp'], 0, p2wsh[2:])
|
||||
|
||||
def encodeSegwit(self, coin_type, raw):
|
||||
return segwit_addr.encode(chainparams[coin_type][self.chain]['hrp'], 0, raw)
|
||||
|
||||
def decodeSegwit(self, coin_type, addr):
|
||||
return bytes(segwit_addr.decode(chainparams[coin_type][self.chain]['hrp'], addr)[1])
|
||||
|
||||
def getScriptAddress(self, coin_type, script):
|
||||
return pubkeyToAddress(chainparams[coin_type][self.chain]['script_address'], script)
|
||||
|
||||
def callrpc(self, method, params=[], wallet=None):
|
||||
return callrpc(self.coin_clients[Coins.PART]['rpcport'], self.coin_clients[Coins.PART]['rpcauth'], method, params, wallet)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user