Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Update wallet_propose method to use ED25519 as the default algorithm #5186

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/test/rpc/KeyGeneration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class WalletPropose_test : public ripple::TestSuite

expectEquals(
result[jss::key_type],
params.isMember(jss::key_type) ? params[jss::key_type]
: "secp256k1");
params.isMember(jss::key_type) ? params[jss::key_type] : "ed25519",
"Logs from testRandomWallet unit test: ");
BEAST_EXPECT(!result.isMember(jss::warning));

std::string seed = result[jss::master_seed].asString();
Expand All @@ -137,8 +137,8 @@ class WalletPropose_test : public ripple::TestSuite
expectEquals(result[jss::public_key_hex], s.public_key_hex);
expectEquals(
result[jss::key_type],
params.isMember(jss::key_type) ? params[jss::key_type]
: "secp256k1");
params.isMember(jss::key_type) ? params[jss::key_type] : "ed25519",
"Logs from testSecretWallet unit test: ");
return result;
}

Expand Down Expand Up @@ -874,7 +874,7 @@ class WalletPropose_test : public ripple::TestSuite
void
run() override
{
testKeyType(std::nullopt, secp256k1_strings);
testKeyType(std::nullopt, ed25519_strings);
testKeyType(std::string("secp256k1"), secp256k1_strings);
testKeyType(std::string("ed25519"), ed25519_strings);
testKeyType(std::string("secp256k1"), strong_brain_strings);
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/rpc/handlers/WalletPropose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ walletPropose(Json::Value const& params)
}

if (!keyType)
keyType = KeyType::secp256k1;
keyType = KeyType::ed25519;

auto const publicKey = generateKeyPair(*keyType, *seed).first;

Expand Down
Loading