Skip to content

Commit

Permalink
feat: renamed deny_list_v2 to deny_list_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriyr committed Oct 22, 2024
1 parent 4dd4f79 commit b841abb
Show file tree
Hide file tree
Showing 117 changed files with 2,594 additions and 2,696 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ unchanged_shared: 0x000000000000000000000000000000000000000000000000000000000000
gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2462400, non_refundable_storage_fee: 0

task 3, lines 42-44:
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
events: Event { package_id: iota, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: iota, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 53, 99, 56, 54, 50, 52, 99, 57, 102, 48, 98, 101, 99, 48, 101, 48, 56, 52, 99, 55, 50, 54, 55, 49, 98, 100, 98, 55, 51, 49, 48, 57, 99, 57, 48, 57, 57, 99, 100, 56, 98, 100, 102, 52, 51, 100, 101, 53, 99, 97, 49, 102, 99, 55, 55, 54, 54, 55, 53, 101, 102, 97, 52, 54, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 173, 20, 36, 200, 181, 21, 60, 120, 45, 218, 193, 45, 246, 36, 87, 61, 75, 182, 91, 243, 61, 21, 2, 57, 202, 83, 119, 226, 222, 241, 82, 42] }
created: object(3,0), object(3,1), object(3,2)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
Expand All @@ -41,7 +41,7 @@ Error: Transaction Effects Status: Address B is denied for coin test::regulated_
Execution Error: ExecutionError: ExecutionError { inner: ExecutionErrorInner { kind: AddressDeniedForCoin { address: B, coin_type: "test::regulated_coin::REGULATED_COIN" }, source: None, command: None } }

task 7, lines 53-55:
//# run iota::coin::deny_list_v2_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2), object(3,1)
gas summary: computation_cost: 1000000, storage_cost: 6862800, storage_rebate: 6862800, non_refundable_storage_fee: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Modifications Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

// This test verifies the basic e2e work flow of coin deny list v2 for receiver of regulated coins.
// This test verifies the basic e2e work flow of coin deny list v1 for receiver of regulated coins.
// Regulated coin issuer can use the deny cap to deny addresses, which will no longer be able to
// receive the coin during execution.
// Undeny the address will restore the original behavior.
Expand All @@ -17,7 +17,7 @@ module test::regulated_coin {
public struct REGULATED_COIN has drop {}

fun init(otw: REGULATED_COIN, ctx: &mut TxContext) {
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2(
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v1(
otw,
9,
b"RC",
Expand All @@ -39,7 +39,7 @@ module test::regulated_coin {
//# run iota::pay::split_and_transfer --args object(1,0) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Deny account B.
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Transfer the regulated coin to @B still works normally.
//# run iota::pay::split_and_transfer --args object(1,0) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A
Expand All @@ -50,7 +50,7 @@ module test::regulated_coin {
//# run iota::pay::split_and_transfer --args object(1,0) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Undeny account B.
//# run iota::coin::deny_list_v2_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Transfer the regulated coin to @B still does not work.
//# run iota::pay::split_and_transfer --args object(1,0) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ task 2, lines 50-52:
//# view-object 1,2
Owner: Account Address ( A )
Version: 2
Contents: iota::coin::DenyCapV2<test::regulated_coin::REGULATED_COIN> {
Contents: iota::coin::DenyCapV1<test::regulated_coin::REGULATED_COIN> {
id: iota::object::UID {
id: iota::object::ID {
bytes: fake(1,2),
Expand All @@ -31,7 +31,7 @@ unchanged_shared: 0x000000000000000000000000000000000000000000000000000000000000
gas summary: computation_cost: 1000000, storage_cost: 3936800, storage_rebate: 2462400, non_refundable_storage_fee: 0

task 4, lines 56-58:
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
events: Event { package_id: iota, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: iota, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 55, 97, 52, 102, 54, 97, 50, 98, 50, 49, 101, 97, 99, 51, 50, 101, 53, 101, 50, 102, 56, 51, 97, 101, 48, 102, 50, 98, 99, 99, 53, 51, 56, 55, 52, 100, 99, 98, 56, 101, 98, 101, 97, 100, 99, 48, 56, 98, 102, 101, 53, 49, 99, 50, 55, 51, 55, 56, 56, 102, 100, 102, 98, 100, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 210, 164, 228, 214, 92, 55, 18, 179, 28, 104, 46, 16, 150, 182, 108, 109, 19, 194, 116, 114, 253, 76, 160, 101, 93, 12, 252, 80, 7, 207, 163, 100] }
created: object(4,0), object(4,1), object(4,2)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
Expand All @@ -52,7 +52,7 @@ task 7, lines 65-67:
Error: Error checking transaction input objects: AddressDeniedForCoin { address: @B, coin_type: "object(1,5)::regulated_coin::REGULATED_COIN" }

task 8, lines 68-70:
//# run iota::coin::deny_list_v2_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
deleted: object(4,1)
gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6862800, non_refundable_storage_fee: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module test::regulated_coin {
public struct REGULATED_COIN has drop {}

fun init(otw: REGULATED_COIN, ctx: &mut TxContext) {
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2(
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v1(
otw,
9,
b"RC",
Expand All @@ -41,19 +41,19 @@ module test::regulated_coin {
addr: address,
expected: bool,
) {
let status = coin::deny_list_v2_contains_next_epoch<REGULATED_COIN>(deny_list, addr);
let status = coin::deny_list_v1_contains_next_epoch<REGULATED_COIN>(deny_list, addr);
assert!(status == expected, 0);
}
}

// This is the deny cap v2 object.
// This is the deny cap v1 object.
//# view-object 1,2

// Transfer away the newly minted coin works normally.
//# run iota::pay::split_and_transfer --args object(1,0) 1 @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Deny account B.
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Assert that the address is denied.
//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B true --sender A
Expand All @@ -65,7 +65,7 @@ module test::regulated_coin {
//# run iota::pay::split_and_transfer --args object(3,0) 1 @A --type-args test::regulated_coin::REGULATED_COIN --sender B

// Undeny account B.
//# run iota::coin::deny_list_v2_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A

// Assert that the address is no longer denied.
//# run test::regulated_coin::assert_address_deny_status --args immshared(0x403) @B false --sender A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Contents: iota::coin::Coin<test::regulated_coin2::REGULATED_COIN2> {
}

task 4, line 68:
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,5) @A --type-args test::regulated_coin2::REGULATED_COIN2 --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,5) @A --type-args test::regulated_coin2::REGULATED_COIN2 --sender A
events: Event { package_id: iota, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: iota, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 98, 99, 101, 99, 51, 97, 97, 52, 51, 57, 100, 56, 51, 57, 52, 99, 99, 56, 55, 50, 57, 52, 99, 51, 51, 100, 57, 50, 102, 98, 50, 97, 48, 56, 101, 56, 52, 99, 52, 97, 102, 49, 97, 57, 101, 56, 102, 50, 100, 98, 51, 53, 50, 97, 50, 98, 101, 49, 99, 97, 48, 51, 56, 53, 55, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 50, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 50, 68, 67, 246, 17, 2, 86, 76, 77, 199, 216, 47, 146, 122, 161, 14, 129, 182, 84, 62, 166, 216, 143, 196, 120, 241, 122, 102, 188, 19, 225, 140, 163] }
created: object(4,0), object(4,1), object(4,2)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module test::regulated_coin1 {
public struct REGULATED_COIN1 has drop {}

fun init(otw: REGULATED_COIN1, ctx: &mut TxContext) {
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2(
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v1(
otw,
9,
b"RC",
Expand All @@ -40,7 +40,7 @@ module test::regulated_coin2 {
public struct REGULATED_COIN2 has drop {}

fun init(otw: REGULATED_COIN2, ctx: &mut TxContext) {
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2(
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v1(
otw,
9,
b"RC",
Expand All @@ -65,7 +65,7 @@ module test::regulated_coin2 {
//# view-object 1,1

// Deny account A for coin2.
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,5) @A --type-args test::regulated_coin2::REGULATED_COIN2 --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,5) @A --type-args test::regulated_coin2::REGULATED_COIN2 --sender A

//# programmable --sender A --inputs object(1,0) object(1,1) @A
//> TransferObjects([Input(0), Input(1)], Input(2))
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ unchanged_shared: 0x000000000000000000000000000000000000000000000000000000000000
gas summary: computation_cost: 1000000, storage_cost: 4119200, storage_rebate: 2462400, non_refundable_storage_fee: 0

task 5, lines 83-85:
//# run iota::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
events: Event { package_id: iota, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: iota, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 98, 53, 49, 101, 54, 51, 102, 98, 102, 48, 101, 55, 57, 50, 102, 99, 55, 55, 56, 100, 50, 56, 48, 102, 54, 52, 56, 50, 55, 101, 100, 49, 100, 54, 51, 55, 54, 54, 49, 98, 49, 97, 55, 48, 54, 51, 52, 49, 50, 101, 57, 99, 55, 100, 100, 51, 97, 48, 49, 56, 54, 102, 97, 50, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 217, 21, 183, 252, 140, 153, 37, 23, 59, 178, 86, 46, 10, 245, 109, 11, 40, 24, 207, 249, 19, 236, 198, 173, 177, 13, 162, 98, 162, 120, 222, 237] }
created: object(5,0), object(5,1), object(5,2)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
Expand Down Expand Up @@ -84,7 +84,7 @@ unchanged_shared: 0x000000000000000000000000000000000000000000000000000000000000
gas summary: computation_cost: 1000000, storage_cost: 988000, storage_rebate: 988000, non_refundable_storage_fee: 0

task 15, lines 114-116:
//# run iota::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2), object(5,1)
gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 6657600, non_refundable_storage_fee: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module test::regulated_coin {
}

fun init(otw: REGULATED_COIN, ctx: &mut TxContext) {
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v2(
let (mut treasury_cap, deny_cap, metadata) = coin::create_regulated_currency_v1(
otw,
9,
b"RC",
Expand Down Expand Up @@ -65,7 +65,7 @@ module test::regulated_coin {
expected: bool,
) {
let status =
coin::deny_list_v2_is_global_pause_enabled_next_epoch<REGULATED_COIN>(deny_list);
coin::deny_list_v1_is_global_pause_enabled_next_epoch<REGULATED_COIN>(deny_list);
assert!(status == expected, 0);
}
}
Expand All @@ -80,7 +80,7 @@ module test::regulated_coin {
//# run test::regulated_coin::partial_wrap --args object(1,0) --sender A

// Enable global pause.
//# run iota::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A

// Assert that global pause is enabled.
//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) true --sender A
Expand Down Expand Up @@ -111,7 +111,7 @@ module test::regulated_coin {
//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) true --sender A

// Disable global pause.
//# run iota::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A

// Assert that global pause is disabled.
//# run test::regulated_coin::assert_global_pause_status --args immshared(0x403) false --sender A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ unchanged_shared: 0x000000000000000000000000000000000000000000000000000000000000
gas summary: computation_cost: 1000000, storage_cost: 20428800, storage_rebate: 0, non_refundable_storage_fee: 0

task 2, lines 55-57:
//# run iota::coin::deny_list_v2_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_add --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
events: Event { package_id: iota, transaction_module: Identifier("coin"), sender: A, type_: StructTag { address: iota, module: Identifier("deny_list"), name: Identifier("PerTypeConfigCreated"), type_params: [] }, contents: [0, 0, 0, 0, 0, 0, 0, 0, 96, 50, 56, 55, 48, 99, 57, 98, 53, 49, 53, 53, 57, 55, 99, 99, 55, 98, 57, 56, 98, 99, 56, 56, 57, 57, 97, 54, 52, 101, 54, 50, 50, 101, 55, 57, 101, 57, 102, 57, 101, 98, 48, 52, 50, 55, 99, 101, 51, 48, 55, 99, 50, 49, 97, 101, 50, 53, 100, 100, 98, 97, 52, 99, 57, 58, 58, 114, 101, 103, 117, 108, 97, 116, 101, 100, 95, 99, 111, 105, 110, 58, 58, 82, 69, 71, 85, 76, 65, 84, 69, 68, 95, 67, 79, 73, 78, 77, 135, 41, 28, 157, 76, 202, 56, 87, 241, 81, 1, 31, 153, 218, 62, 58, 220, 242, 78, 53, 237, 43, 185, 8, 239, 39, 19, 211, 211, 138, 185] }
created: object(2,0), object(2,1), object(2,2)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
gas summary: computation_cost: 1000000, storage_cost: 12190400, storage_rebate: 2774000, non_refundable_storage_fee: 0

task 3, lines 58-60:
//# run iota::coin::deny_list_v2_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_enable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
created: object(3,0)
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
gas summary: computation_cost: 1000000, storage_cost: 6657600, storage_rebate: 4400400, non_refundable_storage_fee: 0
Expand Down Expand Up @@ -88,13 +88,13 @@ Contents: iota::dynamic_field::Field<iota::deny_list::GlobalPauseKey, iota::conf
}

task 6, lines 66-68:
//# run iota::coin::deny_list_v2_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_remove --args object(0x403) object(1,2) @B --type-args test::regulated_coin::REGULATED_COIN --sender A
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
deleted: object(2,1)
gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6862800, non_refundable_storage_fee: 0

task 7, lines 69-71:
//# run iota::coin::deny_list_v2_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
//# run iota::coin::deny_list_v1_disable_global_pause --args object(0x403) object(1,2) --type-args test::regulated_coin::REGULATED_COIN --sender A
mutated: 0x0000000000000000000000000000000000000000000000000000000000000403, object(0,0), object(1,2)
deleted: object(3,0)
gas summary: computation_cost: 1000000, storage_cost: 4400400, storage_rebate: 6657600, non_refundable_storage_fee: 0
Expand Down
Loading

0 comments on commit b841abb

Please sign in to comment.