mirror of
https://github.com/basicswap/basicswap.git
synced 2026-01-28 11:25:10 +01:00
prepare: Set Particl version to 27.2.2.0
Fixes zmq missing curve functions. Fix signmessage for v23.
This commit is contained in:
@@ -53,6 +53,7 @@ class CoinInterface:
|
||||
self._network = network
|
||||
self._mx_wallet = threading.Lock()
|
||||
self._altruistic = True
|
||||
self._core_version = None # Set in getDaemonVersion()
|
||||
|
||||
def interface_type(self) -> int:
|
||||
# coin_type() returns the base coin type, interface_type() returns the coin+balance type.
|
||||
|
||||
@@ -364,7 +364,9 @@ class BTCInterface(Secp256k1Interface):
|
||||
self.rpc_wallet("getwalletinfo" if with_wallet else "getblockchaininfo")
|
||||
|
||||
def getDaemonVersion(self):
|
||||
return self.rpc("getnetworkinfo")["version"]
|
||||
if self._core_version is None:
|
||||
self._core_version = self.rpc("getnetworkinfo")["version"]
|
||||
return self._core_version
|
||||
|
||||
def getBlockchainInfo(self):
|
||||
return self.rpc("getblockchaininfo")
|
||||
|
||||
@@ -191,12 +191,22 @@ class PARTInterface(BTCInterface):
|
||||
raise RuntimeError("No non-segwit outputs found.")
|
||||
|
||||
def signMessage(self, address: str, message: str) -> str:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
return self.rpc_wallet("signmessage", [address, message, message_magic])
|
||||
args = [address, message]
|
||||
if self.getDaemonVersion() > 23020700:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
args += [
|
||||
message_magic,
|
||||
]
|
||||
return self.rpc_wallet("signmessage", args)
|
||||
|
||||
def signMessageWithKey(self, key_wif: str, message: str) -> str:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
return self.rpc("signmessagewithprivkey", [key_wif, message, message_magic])
|
||||
args = [key_wif, message]
|
||||
if self.getDaemonVersion() > 23020700:
|
||||
message_magic: str = self.chainparams()["message_magic"]
|
||||
args += [
|
||||
message_magic,
|
||||
]
|
||||
return self.rpc("signmessagewithprivkey", args)
|
||||
|
||||
|
||||
class PARTInterfaceBlind(PARTInterface):
|
||||
|
||||
@@ -287,7 +287,10 @@ class XMRInterface(CoinInterface):
|
||||
self.rpc_wallet("get_languages")
|
||||
|
||||
def getDaemonVersion(self):
|
||||
return self.rpc_wallet("get_version")["version"]
|
||||
# Returns wallet version
|
||||
if self._core_version is None:
|
||||
self._core_version = self.rpc_wallet("get_version")["version"]
|
||||
return self._core_version
|
||||
|
||||
def getBlockchainInfo(self):
|
||||
get_height = self.rpc2("get_height", timeout=self._rpctimeout)
|
||||
|
||||
Reference in New Issue
Block a user