Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psorinionut committed Jun 5, 2024
1 parent 5c3b990 commit d56ca32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
2 changes: 1 addition & 1 deletion legacy-contracts/simple-lock-legacy/src/proxy_lp.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
multiversx_sc::imports!();
multiversx_sc::derive_imports!();

use crate::{error_messages::CANNOT_UNLOCK_YET_ERR_MSG, locked_token::LockedTokenAttributes};
use crate::locked_token::LockedTokenAttributes;

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Test Coverage

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unused import: `crate::locked_token::LockedTokenAttributes`

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] legacy-contracts/simple-lock-legacy/src/proxy_lp.rs#L4

warning: unused import: `crate::locked_token::LockedTokenAttributes` --> legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5 | 4 | use crate::locked_token::LockedTokenAttributes; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
Raw output
legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5:w:warning: unused import: `crate::locked_token::LockedTokenAttributes`
 --> legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5
  |
4 | use crate::locked_token::LockedTokenAttributes;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default


__END__

Check warning on line 4 in legacy-contracts/simple-lock-legacy/src/proxy_lp.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] legacy-contracts/simple-lock-legacy/src/proxy_lp.rs#L4

warning: unused import: `crate::locked_token::LockedTokenAttributes` --> legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5 | 4 | use crate::locked_token::LockedTokenAttributes; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
Raw output
legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5:w:warning: unused import: `crate::locked_token::LockedTokenAttributes`
 --> legacy-contracts/simple-lock-legacy/src/proxy_lp.rs:4:5
  |
4 | use crate::locked_token::LockedTokenAttributes;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default


__END__

#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)]
pub struct LpProxyTokenAttributes<M: ManagedTypeApi> {
Expand Down
54 changes: 0 additions & 54 deletions legacy-contracts/simple-lock-legacy/tests/rust_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,6 @@ fn unlock_token_test() {
b_mock.check_esdt_balance(sc_wrapper.address_ref(), FREE_TOKEN_ID, &lock_amount);
b_mock.check_esdt_balance(&user_addr, FREE_TOKEN_ID, &rust_zero);

// try unlock too early
b_mock
.execute_esdt_transfer(
&user_addr,
&sc_wrapper,
LOCKED_TOKEN_ID,
lock_token_nonce,
&lock_amount,
|sc| {
sc.unlock_tokens_endpoint(OptionalValue::None);
},
)
.assert_user_error("Cannot unlock yet");

// unlock ok
b_mock.set_block_epoch(10);
b_mock
Expand Down Expand Up @@ -264,20 +250,6 @@ fn exit_lp_test() {
Some(&locked_lp_token_attributes),
);

// try unlock too early
b_mock
.execute_esdt_transfer(
&user_addr,
&sc_wrapper,
LP_PROXY_TOKEN_ID,
lock_token_nonce,
&lock_amount,
|sc| {
sc.remove_liquidity_locked_token(managed_biguint!(0u64), managed_biguint!(0u64));
},
)
.assert_user_error("Cannot unlock yet");

// unlock ok
b_mock.set_block_epoch(10);
b_mock
Expand Down Expand Up @@ -460,32 +432,6 @@ fn exit_farm_test() {
Some(&farm_attributes),
);

// try unlock too early
b_mock
.execute_esdt_transfer(
&user_addr,
&sc_wrapper,
FARM_PROXY_TOKEN_ID,
lock_token_nonce,
&lock_amount,
|sc| {
sc.farm_claim_rewards_locked_token();
},
)
.assert_user_error("Cannot unlock yet");
b_mock
.execute_esdt_transfer(
&user_addr,
&sc_wrapper,
FARM_PROXY_TOKEN_ID,
lock_token_nonce,
&lock_amount,
|sc| {
sc.exit_farm_locked_token();
},
)
.assert_user_error("Cannot unlock yet");

// unlock ok
let half_lock_amount = rust_biguint!(1_000u64);
b_mock.set_block_epoch(10);
Expand Down

0 comments on commit d56ca32

Please sign in to comment.