Skip to content

Commit

Permalink
fix empty err msg when txfee is out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Aug 15, 2024
1 parent c5d6efb commit f89db4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/libxrpl/protocol/TER.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ transResults()
MAKE_ERROR(temINVALID_COUNT, "Malformed: Count field outside valid range."),
MAKE_ERROR(temSEQ_AND_TICKET, "Transaction contains a TicketSequence and a non-zero Sequence."),
MAKE_ERROR(temBAD_NFTOKEN_TRANSFER_FEE, "Malformed: The NFToken transfer fee must be between 1 and 5000, inclusive."),
MAKE_ERROR(temBAD_MPTOKEN_TRANSFER_FEE, "Malformed: The MPToken transfer fee must be between 1 and 5000, inclusive."),
MAKE_ERROR(temXCHAIN_EQUAL_DOOR_ACCOUNTS, "Malformed: Bridge must have unique door accounts."),
MAKE_ERROR(temXCHAIN_BAD_PROOF, "Malformed: Bad cross-chain claim proof."),
MAKE_ERROR(temXCHAIN_BRIDGE_BAD_ISSUES, "Malformed: Bad bridge issues."),
Expand Down
10 changes: 9 additions & 1 deletion src/test/app/MPToken_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MPToken_test : public beast::unit_test::suite
.metadata = "test",
.err = temMALFORMED});

// tries to set a txfee while not enabling transfer
// tries to set a txfee greater than max
mptAlice.create(
{.maxAmt = 100,
.assetScale = 0,
Expand All @@ -67,6 +67,14 @@ class MPToken_test : public beast::unit_test::suite
.flags = tfMPTCanTransfer,
.err = temBAD_MPTOKEN_TRANSFER_FEE});

// tries to set a txfee while not enabling transfer
mptAlice.create(
{.maxAmt = 100,
.assetScale = 0,
.transferFee = maxTransferFee,
.metadata = "test",
.err = temMALFORMED});

// empty metadata returns error
mptAlice.create(
{.maxAmt = 100,
Expand Down

0 comments on commit f89db4b

Please sign in to comment.