Skip to content

Commit

Permalink
test: contract test for native unsupported method
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Jul 31, 2024
1 parent 58178e8 commit 05dbd15
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pop-api/integration-tests/src/local_fungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,34 @@ fn decrease_allowance_works() {
});
}

#[test]
fn native_fungible_methods_unsupported() {
new_test_ext().execute_with(|| {
let _ = env_logger::try_init();
let addr = instantiate(CONTRACT, INIT_VALUE, vec![]);
let amount: Balance = 100 * UNIT;
assert_eq!(
decoded::<Error>(transfer_from(addr.clone(), 0, ALICE, BOB, amount)),
Ok(Module { index: 150, error: 0 })
);

assert_eq!(
decoded::<Error>(increase_allowance(addr.clone(), 0, BOB, amount)),
Ok(Module { index: 150, error: 0 })
);

assert_eq!(
decoded::<Error>(decrease_allowance(addr.clone(), 0, BOB, amount)),
Ok(Module { index: 150, error: 0 })
);

assert_eq!(
decoded::<Error>(approve(addr.clone(), 0, BOB, amount)),
Ok(Module { index: 150, error: 0 })
);
});
}

/// 2. PSP-22 Metadata Interface:
/// - token_name
/// - token_symbol
Expand Down

0 comments on commit 05dbd15

Please sign in to comment.