Skip to content

Commit

Permalink
mop up some residual uses of format strings in errors (no longer supp…
Browse files Browse the repository at this point in the history
…orted) (#961)
  • Loading branch information
graydon authored Aug 3, 2023
1 parent 876fb16 commit 69ef9de
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions soroban-env-host/src/native_contract/token/allowance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ pub fn write_allowance(
Err(err!(
e,
ContractError::AllowanceError,
"expiration is greater than max: {} > {}",
"expiration is greater than max",
expiration,
li.max_entry_expiration
))
} else if amount > 0 && expiration < li.sequence_number {
Err(err!(
e,
ContractError::AllowanceError,
"expiration must be >= ledger sequence: {} < {}",
"expiration must be >= ledger sequence",
expiration,
li.sequence_number
))
Expand Down Expand Up @@ -137,7 +137,7 @@ pub fn spend_allowance(
return Err(err!(
e,
ContractError::AllowanceError,
"not enough allowance to spend: {} < {}",
"not enough allowance to spend",
allowance,
amount
));
Expand Down
4 changes: 2 additions & 2 deletions soroban-env-host/src/native_contract/token/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ fn transfer_account_balance(e: &Host, account_id: AccountId, amount: i64) -> Res
Err(err!(
e,
ContractError::BalanceError,
"resulting balance is not within the allowed range: {} < {} < {} does not hold",
"resulting balance is not within the allowed range",
min_balance,
new_balance,
max_balance
Expand Down Expand Up @@ -457,7 +457,7 @@ fn transfer_trustline_balance(
Err(err!(
e,
ContractError::BalanceError,
"resulting balance is not within the allowed range: {} < {} < {} does not hold",
"resulting balance is not within the allowed range",
min_balance,
new_balance,
max_balance
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/native_contract/token/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fn check_nonnegative_amount(e: &Host, amount: i128) -> Result<(), HostError> {
Err(err!(
e,
ContractError::NegativeAmountError,
"negative amount is not allowed: {}",
"negative amount is not allowed",
amount
))
} else {
Expand Down

0 comments on commit 69ef9de

Please sign in to comment.