Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evelinemolnar committed Sep 11, 2024
1 parent e5daccb commit b36d232
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
12 changes: 2 additions & 10 deletions esdt-safe/tests/esdt_safe_blackbox_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ impl EsdtSafeTestState {

fn init_supply_should_fail(
&mut self,
from_address: TestAddress,
to_address: TestSCAddress,
token_id: TestTokenIdentifier,
tx_token_id: TestTokenIdentifier,
tx_amount: u64,
Expand All @@ -125,8 +123,8 @@ impl EsdtSafeTestState {
) {
self.world
.tx()
.from(from_address)
.to(to_address)
.from(OWNER_ADDRESS)
.to(ESDT_SAFE_ADDRESS)
.typed(esdt_safe_proxy::EsdtSafeProxy)
.init_supply(token_id, BigUint::from(amount))
.egld_or_single_esdt(
Expand Down Expand Up @@ -181,8 +179,6 @@ fn init_supply_test() {
state.config_esdtsafe();

state.init_supply_should_fail(
OWNER_ADDRESS,
ESDT_SAFE_ADDRESS,
NON_WHITELISTED_TOKEN,
NATIVE_TOKEN_ID,
10_000u64,
Expand All @@ -192,8 +188,6 @@ fn init_supply_test() {
);

state.init_supply_should_fail(
OWNER_ADDRESS,
ESDT_SAFE_ADDRESS,
TOKEN_ID,
TOKEN_ID,
10_000u64,
Expand All @@ -203,8 +197,6 @@ fn init_supply_test() {
);

state.init_supply_should_fail(
OWNER_ADDRESS,
ESDT_SAFE_ADDRESS,
TOKEN_WITHOUT_BURN_ROLE,
TOKEN_WITHOUT_BURN_ROLE,
1_000u64,
Expand Down
21 changes: 8 additions & 13 deletions multi-transfer-esdt/tests/multi_transfer_blackbox_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ impl MultiTransferTestState {
expected_status: u64,
expected_error: &str,
) {
let mut tx = self
.esdt_raw_transaction()
self.esdt_raw_transaction()
.set_transaction_batch_status(batch_id, statuses)
.returns(ExpectError(expected_status, expected_error))
.run();
Expand All @@ -344,8 +343,7 @@ impl MultiTransferTestState {
batch_id: u32,
statuses: MultiValueEncoded<StaticApi, TransactionStatus>,
) {
let mut tx = self
.esdt_raw_transaction()
self.esdt_raw_transaction()
.set_transaction_batch_status(batch_id, statuses)
.returns(ReturnsResult)
.run();
Expand All @@ -357,7 +355,6 @@ impl MultiTransferTestState {
to_address: TestSCAddress,
transfers: ManagedVec<StaticApi, Transaction<StaticApi>>,
payment: EgldOrMultiEsdtPayment<StaticApi>,
expected_status: u64,
expected_error: &str,
) {
self.world
Expand All @@ -367,7 +364,7 @@ impl MultiTransferTestState {
.typed(esdt_safe_proxy::EsdtSafeProxy)
.add_refund_batch(transfers)
.egld_or_multi_esdt(payment)
.returns(ExpectError(expected_status, expected_error))
.returns(ExpectError(ERROR, expected_error))
.run();
}

Expand Down Expand Up @@ -787,21 +784,21 @@ fn set_transaction_batch_status_test() {
state.set_transaction_batch_status_should_fail(
5u32,
tx_statuses.clone(),
4,
ERROR,
"Batches must be processed in order",
);

state.set_transaction_batch_status_should_fail(
1u32,
tx_multiple_statuses.clone(),
4,
ERROR,
"Invalid number of statuses provided",
);

state.set_transaction_batch_status_should_fail(
1u32,
tx_statuses_invalid.clone(),
4,
ERROR,
"Transaction status may only be set to Executed or Rejected",
);

Expand Down Expand Up @@ -864,7 +861,6 @@ fn add_refund_batch_test() {
ESDT_SAFE_ADDRESS,
transfers.clone(),
payment.clone(),
4,
"Invalid caller",
);

Expand Down Expand Up @@ -898,7 +894,7 @@ fn add_refund_batch_test() {
transfers.clone(),
BRIDGE_TOKEN_ID,
10u64,
4,
ERROR,
"Token identifiers do not match",
);

Expand All @@ -913,7 +909,6 @@ fn add_refund_batch_test() {
ESDT_SAFE_ADDRESS,
transfers.clone(),
payment_invalid.clone(),
4,
"Amounts do not match",
);

Expand Down Expand Up @@ -971,7 +966,7 @@ fn claim_refund_test() {
state
.esdt_raw_transaction()
.claim_refund(TOKEN_ID)
.with_result(ExpectStatus(4))
.with_result(ExpectStatus(ERROR))
.returns(ExpectError(ERROR, "Nothing to refund"))
.run();

Expand Down

0 comments on commit b36d232

Please sign in to comment.