diff --git a/validators/content_registry_ref_token.ak b/validators/content_registry_ref_token.ak index 85b5a11..6295f7a 100644 --- a/validators/content_registry_ref_token.ak +++ b/validators/content_registry_ref_token.ak @@ -208,3 +208,59 @@ test fail_mint_with_unclean_registry_value() { let ctx = ScriptContext { purpose: Mint(mock_policy_id()), transaction: tx } !content_registry_ref_token(mock_policy_id(), redeemer, ctx) } + +test success_burn() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value(from_asset(policy_id, "", -1)), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + content_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test success_burn_with_other_minting() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value( + from_asset(policy_id, "", -1) |> add(mock_policy_id_2(), "", 1), + ), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + content_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test fail_burn_with_mint() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value(from_asset(policy_id, "", 1)), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + !content_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test fail_burn_with_mix() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value( + from_asset(policy_id, "", -1) |> add(policy_id, "1", 1), + ), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + !content_registry_ref_token(mock_policy_id(), redeemer, ctx) +} diff --git a/validators/ownership_registry_ref_token.ak b/validators/ownership_registry_ref_token.ak index 0b8e8bf..498d1d5 100644 --- a/validators/ownership_registry_ref_token.ak +++ b/validators/ownership_registry_ref_token.ak @@ -208,3 +208,59 @@ test fail_mint_with_unclean_registry_value() { let ctx = ScriptContext { purpose: Mint(mock_policy_id()), transaction: tx } !ownership_registry_ref_token(mock_policy_id(), redeemer, ctx) } + +test success_burn() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value(from_asset(policy_id, "", -1)), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + ownership_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test success_burn_with_other_minting() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value( + from_asset(policy_id, "", -1) |> add(mock_policy_id_2(), "", 1), + ), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + ownership_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test fail_burn_with_mint() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value(from_asset(policy_id, "", 1)), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + !ownership_registry_ref_token(mock_policy_id(), redeemer, ctx) +} + +test fail_burn_with_mix() { + let redeemer = RBurn + let policy_id = mock_policy_id() + + let tx = + Transaction { + ..placeholder(), + mint: to_minted_value( + from_asset(policy_id, "", -1) |> add(policy_id, "1", 1), + ), + } + let ctx = ScriptContext { purpose: Mint(policy_id), transaction: tx } + !ownership_registry_ref_token(mock_policy_id(), redeemer, ctx) +}