Skip to content

Commit

Permalink
fix: Markups
Browse files Browse the repository at this point in the history
  • Loading branch information
dhedey committed Oct 17, 2024
1 parent fb722dc commit df35de0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void registerCodec(CodecMap codecMap) {
codecs -> EnumCodec.fromPermittedRecordSubclasses(MempoolError.class, codecs));
}

record PriorityThresholdNotMet(Option<UInt32> minTipPercentageRequired, UInt32 tipPercentage)
record PriorityThresholdNotMet(Option<UInt32> minTipBasisPointsRequired, UInt32 tipBasisPoints)
implements MempoolError {}

record Duplicate(HashCode notarizedTransactionHash) implements MempoolError {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ public void addTransaction(RawNotarizedTransaction transaction) throws MempoolRe
case MempoolError.PriorityThresholdNotMet
e -> throw new MempoolPriorityThresholdNotMetException(
String.format(
"Mempool is full and transaction's priority threshold not met, min tip percentage"
"Mempool is full and transaction's priority threshold not met, min tip basis points"
+ " required: %s",
e.minTipPercentageRequired()));
e.minTipBasisPointsRequired()));
case MempoolError.Duplicate e -> throw new MempoolDuplicateException(
String.format(
"Mempool already has transaction with notarized hash %s",
Expand Down
6 changes: 3 additions & 3 deletions core-rust/state-manager/src/jni/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl From<Arc<MempoolTransaction>> for JavaPreparedNotarizedTransaction {
enum MempoolAddErrorJava {
PriorityThresholdNotMet {
min_tip_percentage_required: Option<u32>,
tip_percentage: u32,
tip_basis_points: u32,
},
Duplicate(NotarizedTransactionHash),
TransactionValidationError(String),
Expand All @@ -205,10 +205,10 @@ impl From<MempoolAddError> for MempoolAddErrorJava {
match err {
MempoolAddError::PriorityThresholdNotMet {
min_tip_basis_points_required: min_tip_percentage_required,
tip_basis_points: tip_percentage,
tip_basis_points,
} => MempoolAddErrorJava::PriorityThresholdNotMet {
min_tip_percentage_required,
tip_percentage,
tip_basis_points,
},
MempoolAddError::Duplicate(hash) => MempoolAddErrorJava::Duplicate(hash),
MempoolAddError::Rejected(rejection) => {
Expand Down
8 changes: 4 additions & 4 deletions core-rust/state-manager/src/mempool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ impl Display for MempoolAddError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
MempoolAddError::PriorityThresholdNotMet {
min_tip_basis_points_required: min_tip_percentage_required,
tip_basis_points: tip_percentage,
} => match min_tip_percentage_required {
min_tip_basis_points_required,
tip_basis_points,
} => match min_tip_basis_points_required {
None => {
write!(f, "Priority Threshold not met. There is no known tip to guarantee mempool submission.")
}
Some(min_tip_percentage_required) => {
write!(f, "Priority Threshold not met: tip is {tip_percentage} while min tip required {min_tip_percentage_required}")
write!(f, "Priority Threshold not met: tip is {tip_basis_points} basis points while min tip required {min_tip_percentage_required} basis points")
}
},
MempoolAddError::Duplicate(_) => write!(f, "Duplicate Entry"),
Expand Down
2 changes: 1 addition & 1 deletion core-rust/state-manager/src/protocol/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn flash_protocol_update_test() {
.transactions
.remove(0);
let ProtocolUpdateTransaction::FlashTransactionV1(flash) = validator_fee_fix else {
panic!();
panic!("Anenome validator fee fix is known to be a FlashTransactionV1");
};
flash.state_updates
};
Expand Down

0 comments on commit df35de0

Please sign in to comment.