diff --git a/src/key_io.cpp b/src/key_io.cpp index 2591ebf2c9..8a3e5a14ca 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -62,7 +62,7 @@ class DestinationEncoder std::string operator()(const WitnessV16EthHash& id) const { // Raw addr = ETH_ADDR_PREFIX + HexStr(id); - // Produce ETH checksum address: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md + // Produce ERC55 checksum address: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md const auto address = HexStr(id); std::vector input(address.begin(), address.end()); std::vector output; diff --git a/src/masternodes/mn_checks.cpp b/src/masternodes/mn_checks.cpp index 6a6714e8dc..eb2e0abe37 100644 --- a/src/masternodes/mn_checks.cpp +++ b/src/masternodes/mn_checks.cpp @@ -3897,7 +3897,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor { if (!res) return res; } else if (src.domain == static_cast(VMDomain::EVM)) { - // Subtract balance from ETH address + // Subtract balance from ERC55 address CTxDestination dest; ExtractDestination(src.address, dest); const auto fromAddress = std::get(dest); @@ -3932,7 +3932,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor { if (!res) return res; } else if (dst.domain == static_cast(VMDomain::EVM)) { - // Add balance to ETH address + // Add balance to ERC55 address CTxDestination dest; ExtractDestination(dst.address, dest); const auto toAddress = std::get(dest); diff --git a/src/masternodes/rpc_accounts.cpp b/src/masternodes/rpc_accounts.cpp index b3e1be827c..c9c434696d 100644 --- a/src/masternodes/rpc_accounts.cpp +++ b/src/masternodes/rpc_accounts.cpp @@ -531,8 +531,8 @@ UniValue gettokenbalances(const JSONRPCRequest& request) { "Format of amounts output (default = false): (true: obj = {tokenid:amount,...}, false: array = [\"amount@tokenid\"...])"}, {"symbol_lookup", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, "Use token symbols in output (default = false)"}, - {"include_eth", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, - "Whether to include Eth balances in output (default = false)"}, + {"evm", RPCArg::Type::BOOL, RPCArg::Optional::OMITTED, + "Include DFI balances in the EVM layer (default = false): Note: This does not include DST20 tokens"}, }, RPCResult{ "{...} (array) Json object with balances information\n" @@ -577,9 +577,9 @@ UniValue gettokenbalances(const JSONRPCRequest& request) { if (request.params.size() > 2) { symbol_lookup = request.params[2].getBool(); } - auto eth_lookup = false; + auto evm_dfi_lookup = false; if (request.params.size() > 3) { - eth_lookup = request.params[3].getBool(); + evm_dfi_lookup = request.params[3].getBool(); } UniValue ret(UniValue::VARR); @@ -604,7 +604,7 @@ UniValue gettokenbalances(const JSONRPCRequest& request) { return true; }); - if (eth_lookup) { + if (evm_dfi_lookup) { for (const auto keyID : pwallet->GetKeys()) { std::array address{}; std::copy(keyID.begin(), keyID.end(), address.begin()); @@ -682,7 +682,7 @@ UniValue utxostoaccount(const JSONRPCRequest& request) { msg.to = DecodeRecipientsDefaultInternal(pwallet, request.params[0].get_obj()); for (const auto& [to, amount] : msg.to) { - RejectEthAddress(to); + RejectErc55Address(to); } // encode @@ -840,9 +840,9 @@ UniValue accounttoaccount(const JSONRPCRequest& request) { msg.from = DecodeScript(request.params[0].get_str()); for (const auto& [to, amount] : msg.to) { - RejectEthAddress(to); + RejectErc55Address(to); } - RejectEthAddress(msg.from); + RejectErc55Address(msg.from); // encode CDataStream markedMetadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); @@ -930,7 +930,7 @@ UniValue accounttoutxos(const JSONRPCRequest& request) { // decode sender and recipients CAccountToUtxosMessage msg{}; msg.from = DecodeScript(request.params[0].get_str()); - RejectEthAddress(msg.from); + RejectErc55Address(msg.from); const auto to = DecodeRecipients(pwallet->chain(), request.params[1]); msg.balances = SumAllTransfers(to); if (msg.balances.balances.empty()) { @@ -1939,10 +1939,10 @@ UniValue sendtokenstoaddress(const JSONRPCRequest& request) { } for (const auto& [to, amount] : msg.to) { - RejectEthAddress(to); + RejectErc55Address(to); } for (const auto& [from, amount] : msg.from) { - RejectEthAddress(from); + RejectErc55Address(from); } // encode @@ -1999,7 +1999,7 @@ UniValue transferdomain(const JSONRPCRequest& request) { auto pwallet = GetWallet(request); // TODO: Add support for non-JSON parameteric input that's human friendly and intuitive RPCHelpMan{"transferdomain", - "Creates (and submits to local node and network) a tx to transfer balance from DFI/ETH address to DFI/ETH address.\n" + + "Creates (and submits to local node and network) a tx to transfer assets across domains. DVM to EVM/EVM to DVM, etc.\n" + HelpRequiringPassphrase(pwallet) + "\n", { {"array", RPCArg::Type::ARR, RPCArg::Optional::NO, "A json array of src and dst json objects", @@ -2083,7 +2083,7 @@ UniValue transferdomain(const JSONRPCRequest& request) { const auto auth = GetScriptForDestination(WitnessV0KeyHash(key.GetID())); auths.insert(auth); } else { - throw JSONRPCError(RPC_INVALID_PARAMETER,strprintf("Failed to get compressed address for Bech32 equivilent of Eth address")); + throw JSONRPCError(RPC_INVALID_PARAMETER,strprintf("Failed to get compressed address for Bech32 equivilent of ERC55 address")); } } else throw JSONRPCError(RPC_INVALID_PARAMETER,strprintf("Invalid parameters, src argument \"domain\" must be either %d (DFI token to EVM) or %d (EVM to DFI token)", static_cast(VMDomain::DVM), static_cast(VMDomain::EVM))); @@ -2435,7 +2435,7 @@ UniValue HandleSendDFIP2201BTCInput(const JSONRPCRequest& request, CWalletCoinsU throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address"); } const auto script = GetScriptForDestination(dest); - RejectEthAddress(script); + RejectErc55Address(script); CSmartContractMessage msg{}; msg.name = contractPair.first; @@ -2577,7 +2577,7 @@ UniValue futureswap(const JSONRPCRequest& request) { msg.owner = GetScriptForDestination(dest); msg.source = DecodeAmount(pwallet->chain(), request.params[1], ""); - RejectEthAddress(msg.owner); + RejectErc55Address(msg.owner); if (!request.params[2].isNull()) { DCT_ID destTokenID{}; @@ -2681,7 +2681,7 @@ UniValue withdrawfutureswap(const JSONRPCRequest& request) { msg.destination = destTokenID.v; } - RejectEthAddress(msg.owner); + RejectErc55Address(msg.owner); // Encode CDataStream metadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); diff --git a/src/masternodes/rpc_evm.cpp b/src/masternodes/rpc_evm.cpp index 453ca366a0..65e7d6e7f8 100644 --- a/src/masternodes/rpc_evm.cpp +++ b/src/masternodes/rpc_evm.cpp @@ -49,7 +49,7 @@ UniValue evmtx(const JSONRPCRequest &request) { "Creates (and submits to local node and network) a tx to send DFI token to EVM address.\n" + HelpRequiringPassphrase(pwallet) + "\n", { - {"from", RPCArg::Type::STR, RPCArg::Optional::NO, "From Eth address"}, + {"from", RPCArg::Type::STR, RPCArg::Optional::NO, "From ERC55 address"}, {"nonce", RPCArg::Type::NUM, RPCArg::Optional::NO, "Transaction nonce"}, {"gasPrice", RPCArg::Type::NUM, RPCArg::Optional::NO, "Gas Price in Gwei"}, {"gasLimit", RPCArg::Type::NUM, RPCArg::Optional::NO, "Gas limit"}, diff --git a/src/masternodes/rpc_loan.cpp b/src/masternodes/rpc_loan.cpp index a9f1efbc89..d0e503a814 100644 --- a/src/masternodes/rpc_loan.cpp +++ b/src/masternodes/rpc_loan.cpp @@ -1075,7 +1075,7 @@ UniValue takeloan(const JSONRPCRequest& request) { if (!metaObj["to"].isNull()) takeLoan.to = DecodeScript(metaObj["to"].getValStr()); - RejectEthAddress(takeLoan.to); + RejectErc55Address(takeLoan.to); if (!metaObj["amounts"].isNull()) takeLoan.amounts = DecodeAmounts(pwallet->chain(), metaObj["amounts"], ""); @@ -1267,7 +1267,7 @@ UniValue paybackloan(const JSONRPCRequest& request) { } else from = DecodeScript(metaObj["from"].getValStr()); - RejectEthAddress(from); + RejectErc55Address(from); if (!::IsMine(*pwallet, from)) throw JSONRPCError(RPC_INVALID_PARAMETER, diff --git a/src/masternodes/rpc_poolpair.cpp b/src/masternodes/rpc_poolpair.cpp index 7e84d815a4..cf10e2e8e8 100644 --- a/src/masternodes/rpc_poolpair.cpp +++ b/src/masternodes/rpc_poolpair.cpp @@ -403,9 +403,9 @@ UniValue addpoolliquidity(const JSONRPCRequest &request) { msg.shareAddress = DecodeScript(request.params[1].get_str()); for (const auto& [from, balance] : msg.from) { - RejectEthAddress(from); + RejectErc55Address(from); } - RejectEthAddress(msg.shareAddress); + RejectErc55Address(msg.shareAddress); // encode CDataStream markedMetadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); @@ -500,7 +500,7 @@ UniValue removepoolliquidity(const JSONRPCRequest &request) { msg.from = DecodeScript(from); msg.amount = DecodeAmount(pwallet->chain(), amount, from); - RejectEthAddress(msg.from); + RejectErc55Address(msg.from); // encode CDataStream markedMetadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); @@ -641,7 +641,7 @@ UniValue createpoolpair(const JSONRPCRequest &request) { if (!metadataObj["customRewards"].isNull()) { rewards = DecodeAmounts(pwallet->chain(), metadataObj["customRewards"], ""); } - RejectEthAddress(ownerAddress); + RejectErc55Address(ownerAddress); int targetHeight; DCT_ID idtokenA, idtokenB; @@ -821,7 +821,7 @@ UniValue updatepoolpair(const JSONRPCRequest &request) { std::numeric_limits::max())); } } - RejectEthAddress(ownerAddress); + RejectErc55Address(ownerAddress); const auto txVersion = GetTransactionVersion(targetHeight); CMutableTransaction rawTx(txVersion); @@ -939,8 +939,8 @@ UniValue poolswap(const JSONRPCRequest &request) { CheckAndFillPoolSwapMessage(request, poolSwapMsg); int targetHeight = chainHeight(*pwallet->chain().lock()) + 1; - RejectEthAddress(poolSwapMsg.from); - RejectEthAddress(poolSwapMsg.to); + RejectErc55Address(poolSwapMsg.from); + RejectErc55Address(poolSwapMsg.to); CDataStream metadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); metadata << static_cast(CustomTxType::PoolSwap); @@ -1060,8 +1060,8 @@ UniValue compositeswap(const JSONRPCRequest &request) { CPoolSwapMessage &poolSwapMsg = poolSwapMsgV2.swapInfo; CheckAndFillPoolSwapMessage(request, poolSwapMsg); - RejectEthAddress(poolSwapMsg.from); - RejectEthAddress(poolSwapMsg.to); + RejectErc55Address(poolSwapMsg.from); + RejectErc55Address(poolSwapMsg.to); { LOCK(cs_main); diff --git a/src/masternodes/rpc_proposals.cpp b/src/masternodes/rpc_proposals.cpp index 9de5a07b26..2db92fd5c8 100644 --- a/src/masternodes/rpc_proposals.cpp +++ b/src/masternodes/rpc_proposals.cpp @@ -269,7 +269,7 @@ UniValue creategovcfp(const JSONRPCRequest &request) { pm.contextHash = contextHash; pm.options = 0; - RejectEthAddress(pm.address); + RejectErc55Address(pm.address); // encode CDataStream metadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); diff --git a/src/masternodes/rpc_vault.cpp b/src/masternodes/rpc_vault.cpp index 7627401dd2..7625e10921 100644 --- a/src/masternodes/rpc_vault.cpp +++ b/src/masternodes/rpc_vault.cpp @@ -303,7 +303,7 @@ UniValue createvault(const JSONRPCRequest& request) { CVaultMessage vault; vault.ownerAddress = DecodeScript(request.params[0].getValStr()); - RejectEthAddress(vault.ownerAddress); + RejectErc55Address(vault.ownerAddress); if (request.params.size() > 1) { if (!request.params[1].isNull()) { @@ -409,7 +409,7 @@ UniValue closevault(const JSONRPCRequest& request) { msg.to = DecodeScript(request.params[1].getValStr()); - RejectEthAddress(msg.to); + RejectErc55Address(msg.to); CDataStream metadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); metadata << static_cast(CustomTxType::CloseVault) @@ -718,7 +718,7 @@ UniValue updatevault(const JSONRPCRequest& request) { msg.ownerAddress = DecodeScript(ownerAddress); } - RejectEthAddress(msg.ownerAddress); + RejectErc55Address(msg.ownerAddress); if(!params["loanSchemeId"].isNull()){ auto loanschemeid = params["loanSchemeId"].getValStr(); @@ -808,7 +808,7 @@ UniValue deposittovault(const JSONRPCRequest& request) { // decode vaultId CVaultId vaultId = ParseHashV(request.params[0], "vaultId"); auto from = DecodeScript(request.params[1].get_str()); - RejectEthAddress(from); + RejectErc55Address(from); CTokenAmount amount = DecodeAmount(pwallet->chain(),request.params[2].get_str(), "amount"); CDepositToVaultMessage msg{vaultId, from, amount}; @@ -895,7 +895,7 @@ UniValue withdrawfromvault(const JSONRPCRequest& request) { // decode vaultId CVaultId vaultId = ParseHashV(request.params[0], "vaultId"); auto to = DecodeScript(request.params[1].get_str()); - RejectEthAddress(to); + RejectErc55Address(to); CTokenAmount amount = DecodeAmount(pwallet->chain(),request.params[2].get_str(), "amount"); CWithdrawFromVaultMessage msg{vaultId, to, amount}; @@ -1014,7 +1014,7 @@ UniValue placeauctionbid(const JSONRPCRequest& request) { from = DecodeScript(fromStr); } - RejectEthAddress(from); + RejectErc55Address(from); CAuctionBidMessage msg{vaultId, index, from, amount}; CDataStream markedMetadata(DfTxMarker, SER_NETWORK, PROTOCOL_VERSION); diff --git a/src/outputtype.cpp b/src/outputtype.cpp index e47a4eb2fd..80274340e5 100644 --- a/src/outputtype.cpp +++ b/src/outputtype.cpp @@ -18,7 +18,6 @@ static const std::string OUTPUT_TYPE_STRING_LEGACY = "legacy"; static const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = "p2sh-segwit"; static const std::string OUTPUT_TYPE_STRING_BECH32 = "bech32"; static const std::string OUTPUT_TYPE_STRING_ERC55 = "erc55"; -static const std::string OUTPUT_TYPE_STRING_ETH = "eth"; bool ParseOutputType(const std::string& type, OutputType& output_type) { @@ -31,8 +30,8 @@ bool ParseOutputType(const std::string& type, OutputType& output_type) } else if (type == OUTPUT_TYPE_STRING_BECH32) { output_type = OutputType::BECH32; return true; - } else if (type == OUTPUT_TYPE_STRING_ERC55 || type == OUTPUT_TYPE_STRING_ETH) { - output_type = OutputType::ETH; + } else if (type == OUTPUT_TYPE_STRING_ERC55) { + output_type = OutputType::ERC55; return true; } return false; @@ -44,7 +43,7 @@ const std::string& FormatOutputType(OutputType type) case OutputType::LEGACY: return OUTPUT_TYPE_STRING_LEGACY; case OutputType::P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT; case OutputType::BECH32: return OUTPUT_TYPE_STRING_BECH32; - case OutputType::ETH: return OUTPUT_TYPE_STRING_ETH; + case OutputType::ERC55: return OUTPUT_TYPE_STRING_ERC55; default: assert(false); } } @@ -64,7 +63,7 @@ CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type) return witdest; } } - case OutputType::ETH: { + case OutputType::ERC55: { CPubKey pubkeyCopy = key; if (pubkeyCopy.IsCompressed()) { pubkeyCopy.Decompress(); diff --git a/src/outputtype.h b/src/outputtype.h index 0c0ca36760..df6a2b16b4 100644 --- a/src/outputtype.h +++ b/src/outputtype.h @@ -17,7 +17,7 @@ enum class OutputType { LEGACY, P2SH_SEGWIT, BECH32, - ETH, + ERC55, /** * Special output type for change outputs only. Automatically choose type diff --git a/src/rpc/rawtransaction_util.cpp b/src/rpc/rawtransaction_util.cpp index dc4fd1bc17..6fd9fccf3a 100644 --- a/src/rpc/rawtransaction_util.cpp +++ b/src/rpc/rawtransaction_util.cpp @@ -86,10 +86,10 @@ CScript DecodeScript(std::string const& str) return GetScriptForDestination(dest); } -void RejectEthAddress(const CScript &address) { +void RejectErc55Address(const CScript &address) { CTxDestination dest; if (ExtractDestination(address, dest) && dest.index() == WitV16KeyEthHashType) { - throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Eth type addresses are not valid"); + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "ERC55 addresses not supported"); } } @@ -262,7 +262,7 @@ CMutableTransaction ConstructTransaction(const UniValue& inputs_in, const UniVal } CScript scriptPubKey = GetScriptForDestination(destination); - RejectEthAddress(scriptPubKey); + RejectErc55Address(scriptPubKey); auto amounts = DecodeAmounts(chain, outputs[name_], name_); for (auto const & kv : amounts.balances) { diff --git a/src/rpc/rawtransaction_util.h b/src/rpc/rawtransaction_util.h index b10afad3ad..55395a3b4c 100644 --- a/src/rpc/rawtransaction_util.h +++ b/src/rpc/rawtransaction_util.h @@ -28,7 +28,7 @@ ResVal> ParseTokenAmount(std::string const & tok ResVal GuessTokenAmount(interfaces::Chain const & chain,std::string const & tokenAmount); CScript DecodeScript(std::string const& str); -void RejectEthAddress(const CScript &address); +void RejectErc55Address(const CScript &address); CTokenAmount DecodeAmount(interfaces::Chain const & chain, UniValue const& amountUni, std::string const& name); CBalances DecodeAmounts(interfaces::Chain const & chain, UniValue const& amountsUni, std::string const& name); CAccounts DecodeRecipients(interfaces::Chain const & chain, UniValue const& sendTo); diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 1d52fcf0e5..7f70619c30 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -222,7 +222,7 @@ bool static CheckPubKeyEncoding(const valtype &vchPubKey, unsigned int flags, co if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SigVersion::WITNESS_V0 && !IsCompressedPubKey(vchPubKey)) { return set_error(serror, SCRIPT_ERR_WITNESS_PUBKEYTYPE); } - // Only uncompressed keys are accepted in Eth addresses + // Only uncompressed keys are accepted in ERC55 addresses if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SigVersion::WITNESS_V16 && IsCompressedPubKey(vchPubKey)) { return set_error(serror, SCRIPT_ERR_WITNESS_ETHKEYTYPE); } diff --git a/src/script/standard.h b/src/script/standard.h index 1dcdd3fba6..f17602e733 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -148,7 +148,7 @@ struct WitnessUnknown { * * WitnessV0ScriptHash: TX_WITNESS_V0_SCRIPTHASH destination (P2WSH) * * WitnessV0KeyHash: TX_WITNESS_V0_KEYHASH destination (P2WPKH) * * WitnessUnknown: TX_WITNESS_UNKNOWN destination (P2W???) - * * WitnessV16EthHash: Eth address type. Not a valid destination, here for address support anly. + * * WitnessV16EthHash: ERC55 address type. Not a valid destination, here for address support anly. * A CTxDestination is the internal data type encoded in a DFI address */ using CTxDestination = std::variant; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 947614abd9..4405f039df 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -421,7 +421,7 @@ static UniValue sendtoaddress(const JSONRPCRequest& request) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address"); } - RejectEthAddress(GetScriptForDestination(dest)); + RejectErc55Address(GetScriptForDestination(dest)); // Amount CTokenAmount const tokenAmount = DecodeAmount(pwallet->chain(), request.params[1], request.params[0].get_str()); // don't support multiple tokens due to "SendMoney()" compatibility @@ -924,7 +924,7 @@ static UniValue sendmany(const JSONRPCRequest& request) for (auto const & scriptBalances : recip) { - RejectEthAddress(scriptBalances.first); + RejectErc55Address(scriptBalances.first); bool fSubtractFeeFromAmount = false; for (unsigned int idx = 0; idx < subtractFeeFromAmount.size(); idx++) { @@ -1133,6 +1133,11 @@ UniValue ListReceived(interfaces::Chain::Lock& locked_chain, CWallet * const pwa const CTxDestination& address = item_it->first; // Do not display Eth addresses + // + // This is ok since it's not allowed on mainnet due as these + // will be non-standard TX. + // TODO: flag it later to optionally display later. + if (address.index() == WitV16KeyEthHashType) { continue; } @@ -4260,8 +4265,8 @@ UniValue addressmap(const JSONRPCRequest &request) { { {"input", RPCArg::Type::STR, RPCArg::Optional::NO, "DVM address or EVM address"}, {"type", RPCArg::Type::NUM, RPCArg::Optional::NO, "Map types: \n\ - 1 - Address format: DFI -> ETH \n\ - 2 - Address format: ETH -> DFI \n"} + 1 - Address format: DFI -> ERC55 \n\ + 2 - Address format: ERC55 -> DFI \n"} }, RPCResult{ "{\n" diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ca748f1b5d..6d6f1c5e64 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3850,7 +3850,7 @@ bool CWallet::GetNewDestination(const OutputType type, const std::string label, SetAddressBook(dest, label, "receive"); auto [uncomp, comp] = GetBothPubkeyCompressions(new_key); - SetAddressBook(GetDestinationForKey(uncomp, OutputType::ETH), label, "receive"); + SetAddressBook(GetDestinationForKey(uncomp, OutputType::ERC55), label, "receive"); SetAddressBook(GetDestinationForKey(uncomp, OutputType::LEGACY), label, "receive"); SetAddressBook(GetDestinationForKey(comp, OutputType::BECH32), label, "receive"); @@ -4808,7 +4808,7 @@ void CWallet::LearnRelatedScripts(const CPubKey& key, OutputType type) // Make sure the resulting program is solvable. assert(IsSolvable(*this, witprog)); AddCScript(witprog); - } else if (!key.IsCompressed() && type == OutputType::ETH) { + } else if (!key.IsCompressed() && type == OutputType::ERC55) { CScript script = GetScriptForDestination(WitnessV16EthHash(key)); AddCScript(script); } diff --git a/test/functional/feature_evm.py b/test/functional/feature_evm.py index 083e43f31c..71712d9a92 100755 --- a/test/functional/feature_evm.py +++ b/test/functional/feature_evm.py @@ -220,11 +220,11 @@ def run_test(self): assert_equal(len(self.nodes[0].getaccount(eth_address, {}, True)), 1) # Check for invalid parameters in transferdomain rpc - assert_raises_rpc_error(-5, "Eth type addresses are not valid", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 1}], [{eth_address: 1}]) - assert_raises_rpc_error(-5, "Eth type addresses are not valid", self.nodes[0].sendmany, "", {eth_address: 1}) - assert_raises_rpc_error(-5, "Eth type addresses are not valid", self.nodes[0].sendmany, "", {eth_address: 1}) - assert_raises_rpc_error(-5, "Eth type addresses are not valid", self.nodes[0].sendtoaddress, eth_address, 1) - assert_raises_rpc_error(-5, "Eth type addresses are not valid", self.nodes[0].accounttoaccount, address, {eth_address: "1@DFI"}) + assert_raises_rpc_error(-5, "ERC55 addresses not supported", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 1}], [{eth_address: 1}]) + assert_raises_rpc_error(-5, "ERC55 addresses not supported", self.nodes[0].sendmany, "", {eth_address: 1}) + assert_raises_rpc_error(-5, "ERC55 addresses not supported", self.nodes[0].sendmany, "", {eth_address: 1}) + assert_raises_rpc_error(-5, "ERC55 addresses not supported", self.nodes[0].sendtoaddress, eth_address, 1) + assert_raises_rpc_error(-5, "ERC55 addresses not supported", self.nodes[0].accounttoaccount, address, {eth_address: "1@DFI"}) # Deactivate transferdomain DVM to EVM self.nodes[0].setgov({"ATTRIBUTES": {'v0/transferdomain/evm-dvm/enabled': 'false'}}) diff --git a/test/functional/wallet_hd.py b/test/functional/wallet_hd.py index 03a88c2c88..dbdeadbd4f 100755 --- a/test/functional/wallet_hd.py +++ b/test/functional/wallet_hd.py @@ -185,7 +185,7 @@ def run_test(self): assert_equal(result['labels'][0]['purpose'], 'eth') # Make sure TX to Eth address are not valid - assert_raises_rpc_error(-5, 'Eth type addresses are not valid', self.nodes[0].sendtoaddress, eth_addr, 1) + assert_raises_rpc_error(-5, 'ERC55 addresses not supported', self.nodes[0].sendtoaddress, eth_addr, 1) # Dump and import address into node 1 priv_key = self.nodes[0].dumpprivkey(eth_addr)