fix test error

This commit is contained in:
tequ
2025-09-15 22:07:43 +09:00
parent 6c0732ccbe
commit 2a27280f1a
4 changed files with 13 additions and 4 deletions

View File

@@ -110,7 +110,7 @@ public:
getMentionedAccounts() const;
static Blob
getSigningData(STTx const& that);
getSigningData(STObject const& that);
static Blob
getSponsorSigningData(STTx const& that);

View File

@@ -186,7 +186,7 @@ STTx::getMentionedAccounts() const
}
Blob
STTx::getSigningData(STTx const& that)
STTx::getSigningData(STObject const& that)
{
Serializer s;
s.add32(HashPrefix::txSign);
@@ -507,7 +507,7 @@ multiSignHelper(
// Make sure the MultiSigners are present. Otherwise they are not
// attempting multi-signing and we just have a bad Signers.
if (!signerObj.isFieldPresent(sfSigners))
return Unexpected("Empty Signers.");
return Unexpected("Empty SigningPubKey.");
// We don't allow both an sfSigners and an sfTxnSignature. Both fields
// being present would indicate that the transaction is signed both ways.

View File

@@ -2313,6 +2313,15 @@ class MPToken_test : public beast::unit_test::suite
reward = STAmount{sfSignatureReward, USD(10)};
minAmount = STAmount{sfMinAccountCreateAmount, mpt};
}
// SponsorshipSet
{
Json::Value jv;
jv[jss::TransactionType] = jss::SponsorshipSet;
jv[jss::Account] = alice.human();
jv[sfSponsee.fieldName] = carol.human();
jv[sfFeeAmount.fieldName] = mpt.getJson(JsonOptions::none);
test(jv, sfFeeAmount.fieldName.c_str());
}
}
BEAST_EXPECT(txWithAmounts.empty());
}

View File

@@ -47,7 +47,7 @@ void
sign(Json::Value& jv, Account const& account)
{
jv[jss::SigningPubKey] = strHex(account.pk().slice());
auto const blob = STTx::getSigningData(STTx{parse(jv)});
auto const blob = STTx::getSigningData(parse(jv));
auto const sig = ripple::sign(account.pk(), account.sk(), makeSlice(blob));
jv[jss::TxnSignature] = strHex(Slice{sig.data(), sig.size()});
}