Skip to content

Commit

Permalink
Merge branch 'master' into digital-cash-multi-fee
Browse files Browse the repository at this point in the history
  • Loading branch information
alyn509 authored Sep 25, 2023
2 parents 02a910c + d80a858 commit fc4aaaf
Show file tree
Hide file tree
Showing 10 changed files with 1,942 additions and 1,512 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use forwarder::nft::{Color, ForwarderNftModule};
use multiversx_sc::{contract_base::ContractBase, types::Address};
use multiversx_sc_scenario::{
managed_address, managed_biguint, managed_token_id, rust_biguint,
managed_address, managed_biguint, managed_token_id,
scenario_model::{
Account, AddressValue, CheckAccount, CheckStateStep, ScCallStep, SetStateStep,
},
Expand Down Expand Up @@ -88,7 +88,7 @@ fn test_nft_update_attributes_and_send() {
&forwarder_whitebox,
ScCallStep::new()
.from(USER_ADDRESS_EXPR)
.esdt_transfer(NFT_TOKEN_ID, 1, rust_biguint!(1)),
.esdt_transfer(NFT_TOKEN_ID, 1, "1"),
|sc| {
sc.nft_update_attributes(managed_token_id!(NFT_TOKEN_ID), 1, new_attributes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use multiversx_sc::types::{
};
use multiversx_sc_modules::transfer_role_proxy::TransferRoleProxyModule;
use multiversx_sc_scenario::{
managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint,
managed_address, managed_biguint, managed_buffer, managed_token_id,
scenario_model::{
Account, AddressValue, CheckAccount, CheckStateStep, ScCallStep, ScDeployStep, SetStateStep,
},
Expand Down Expand Up @@ -95,7 +95,7 @@ fn test_transfer_role() {
ScCallStep::new().from(USER_ADDRESS_EXPR).esdt_transfer(
TRANSFER_TOKEN_ID,
0,
rust_biguint!(100),
"100",
),
|sc| {
let payments = ManagedVec::from_single_item(EsdtTokenPayment::new(
Expand All @@ -114,19 +114,19 @@ fn test_transfer_role() {

world.check_state_step(CheckStateStep::new().put_account(
USER_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(900)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "900"),
));
world.check_state_step(CheckStateStep::new().put_account(
OWNER_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(100)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "100"),
));

// transfer to user - err, not whitelisted
world.whitebox_call_check(
&transfer_role_features_whitebox,
ScCallStep::new()
.from(USER_ADDRESS_EXPR)
.esdt_transfer(TRANSFER_TOKEN_ID, 0, rust_biguint!(100))
.esdt_transfer(TRANSFER_TOKEN_ID, 0, "100")
.no_expect(),
|sc| {
let payments = ManagedVec::from_single_item(EsdtTokenPayment::new(
Expand All @@ -152,7 +152,7 @@ fn test_transfer_role() {
ScCallStep::new().from(USER_ADDRESS_EXPR).esdt_transfer(
TRANSFER_TOKEN_ID,
0,
rust_biguint!(100),
"100",
),
|sc| {
let payments = ManagedVec::from_single_item(EsdtTokenPayment::new(
Expand All @@ -173,11 +173,11 @@ fn test_transfer_role() {

world.check_state_step(CheckStateStep::new().put_account(
USER_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(800)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "800"),
));
world.check_state_step(CheckStateStep::new().put_account(
VAULT_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(100)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "100"),
));

// transfer to sc - reject
Expand All @@ -186,7 +186,7 @@ fn test_transfer_role() {
ScCallStep::new().from(USER_ADDRESS_EXPR).esdt_transfer(
TRANSFER_TOKEN_ID,
0,
rust_biguint!(100),
"100",
),
|sc| {
let payments = ManagedVec::from_single_item(EsdtTokenPayment::new(
Expand All @@ -207,11 +207,11 @@ fn test_transfer_role() {

world.check_state_step(CheckStateStep::new().put_account(
USER_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(800)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "800"),
));
world.check_state_step(CheckStateStep::new().put_account(
VAULT_ADDRESS_EXPR,
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, &rust_biguint!(100)),
CheckAccount::new().esdt_balance(TRANSFER_TOKEN_ID_EXPR, "100"),
));
}

Expand Down
Loading

0 comments on commit fc4aaaf

Please sign in to comment.