mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
Update error code for transfer rate error (#7115)
This commit is contained in:
@@ -74,7 +74,7 @@ MPTokenIssuanceCreate::preflight(PreflightContext const& ctx)
|
||||
|
||||
// Confidential amounts are encrypted so transfer rate is disallowed.
|
||||
if (fee > 0u && ctx.tx.isFlag(tfMPTCanConfidentialAmount))
|
||||
return temMALFORMED;
|
||||
return temBAD_TRANSFER_FEE;
|
||||
}
|
||||
|
||||
if (auto const domain = ctx.tx[~sfDomainID])
|
||||
|
||||
@@ -171,7 +171,7 @@ MPTokenIssuanceSet::preflight(PreflightContext const& ctx)
|
||||
// in the same transaction is not allowed.
|
||||
if ((transferFee.value_or(0) > 0u) &&
|
||||
((*mutableFlags & tmfMPTSetCanConfidentialAmount) != 0u))
|
||||
return temMALFORMED;
|
||||
return temBAD_TRANSFER_FEE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1179,7 +1179,7 @@ class ConfidentialTransfer_test : public beast::unit_test::Suite
|
||||
mptAlice.create({
|
||||
.transferFee = 100,
|
||||
.flags = tfMPTCanTransfer | tfMPTCanConfidentialAmount,
|
||||
.err = temMALFORMED,
|
||||
.err = temBAD_TRANSFER_FEE,
|
||||
});
|
||||
|
||||
// transferFee being 0 is allowed, even with tfMPTCanConfidentialAmount
|
||||
@@ -1206,7 +1206,7 @@ class ConfidentialTransfer_test : public beast::unit_test::Suite
|
||||
.account = alice,
|
||||
.mutableFlags = tmfMPTSetCanConfidentialAmount,
|
||||
.transferFee = 100,
|
||||
.err = temMALFORMED,
|
||||
.err = temBAD_TRANSFER_FEE,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1249,6 +1249,12 @@ class ConfidentialTransfer_test : public beast::unit_test::Suite
|
||||
.transferFee = 100,
|
||||
.err = tecNO_PERMISSION,
|
||||
});
|
||||
|
||||
// Setting transfer fee to 0 is allowed, but have no effect.
|
||||
mptAlice.set({
|
||||
.account = alice,
|
||||
.transferFee = 0,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user