From 05dbd159cf56e0186f3d57afb2ac03cb90570cec Mon Sep 17 00:00:00 2001 From: tin-snowflake <56880684+chungquantin@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:01:19 +0800 Subject: [PATCH] test: contract test for native unsupported method --- .../integration-tests/src/local_fungibles.rs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pop-api/integration-tests/src/local_fungibles.rs b/pop-api/integration-tests/src/local_fungibles.rs index 88580618..94609f29 100644 --- a/pop-api/integration-tests/src/local_fungibles.rs +++ b/pop-api/integration-tests/src/local_fungibles.rs @@ -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::(transfer_from(addr.clone(), 0, ALICE, BOB, amount)), + Ok(Module { index: 150, error: 0 }) + ); + + assert_eq!( + decoded::(increase_allowance(addr.clone(), 0, BOB, amount)), + Ok(Module { index: 150, error: 0 }) + ); + + assert_eq!( + decoded::(decrease_allowance(addr.clone(), 0, BOB, amount)), + Ok(Module { index: 150, error: 0 }) + ); + + assert_eq!( + decoded::(approve(addr.clone(), 0, BOB, amount)), + Ok(Module { index: 150, error: 0 }) + ); + }); +} + /// 2. PSP-22 Metadata Interface: /// - token_name /// - token_symbol