From c06f7e47650284366fb8be81bc6c2cc7a4f78e7c Mon Sep 17 00:00:00 2001 From: Maciej Dfinity Date: Tue, 25 Nov 2025 13:02:07 +0000 Subject: [PATCH 1/4] add 107 to the archive list of supported standards --- rs/ledger_suite/icrc1/ledger/src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rs/ledger_suite/icrc1/ledger/src/main.rs b/rs/ledger_suite/icrc1/ledger/src/main.rs index 55879c83ecc4..44723d4766d8 100644 --- a/rs/ledger_suite/icrc1/ledger/src/main.rs +++ b/rs/ledger_suite/icrc1/ledger/src/main.rs @@ -1087,6 +1087,10 @@ fn icrc3_supported_block_types() -> Vec Date: Tue, 25 Nov 2025 13:44:21 +0000 Subject: [PATCH 2/4] move the type from ledger to archive --- rs/ledger_suite/icrc1/archive/src/main.rs | 4 ++++ rs/ledger_suite/icrc1/ledger/src/main.rs | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rs/ledger_suite/icrc1/archive/src/main.rs b/rs/ledger_suite/icrc1/archive/src/main.rs index baa91a0b84c2..158aa913a3a1 100644 --- a/rs/ledger_suite/icrc1/archive/src/main.rs +++ b/rs/ledger_suite/icrc1/archive/src/main.rs @@ -348,6 +348,10 @@ fn icrc3_supported_block_types() -> Vec { url: "https://github.com/dfinity/ICRC-1/blob/main/standards/ICRC-2/README.md" .to_string(), }, + SupportedBlockType { + block_type: "107feecol".to_string(), + url: "https://github.com/dfinity/ICRC/pull/117".to_string(), + }, ] } diff --git a/rs/ledger_suite/icrc1/ledger/src/main.rs b/rs/ledger_suite/icrc1/ledger/src/main.rs index 44723d4766d8..55879c83ecc4 100644 --- a/rs/ledger_suite/icrc1/ledger/src/main.rs +++ b/rs/ledger_suite/icrc1/ledger/src/main.rs @@ -1087,10 +1087,6 @@ fn icrc3_supported_block_types() -> Vec Date: Tue, 25 Nov 2025 17:39:08 +0000 Subject: [PATCH 3/4] add test --- rs/ledger_suite/icrc1/archive/tests/tests.rs | 11 ++++++++++- rs/ledger_suite/tests/sm-tests/src/lib.rs | 17 +++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/rs/ledger_suite/icrc1/archive/tests/tests.rs b/rs/ledger_suite/icrc1/archive/tests/tests.rs index e928a2766f45..6c0bd75a8a5f 100644 --- a/rs/ledger_suite/icrc1/archive/tests/tests.rs +++ b/rs/ledger_suite/icrc1/archive/tests/tests.rs @@ -2,7 +2,9 @@ use candid::{Decode, Encode, Nat, Principal}; use ic_base_types::CanisterId; use ic_icrc1::blocks::encoded_block_to_generic_block; use ic_ledger_core::block::{BlockType, EncodedBlock}; -use ic_ledger_suite_state_machine_tests::test_http_request_decoding_quota; +use ic_ledger_suite_state_machine_tests::{ + check_icrc3_supported_block_types, test_http_request_decoding_quota, +}; use ic_state_machine_tests::{StateMachine, WasmResult}; use icrc_ledger_types::icrc::generic_value::ICRC3Value; use icrc_ledger_types::icrc1::account::Account; @@ -352,3 +354,10 @@ fn test_archive_http_request_decoding_quota() { test_http_request_decoding_quota(&setup.state_machine, setup.archive_id); } + +#[test] +fn test_icrc3_supported_block_types() { + let setup = Setup::default(); + + check_icrc3_supported_block_types(&setup.state_machine, setup.archive_id, true); +} diff --git a/rs/ledger_suite/tests/sm-tests/src/lib.rs b/rs/ledger_suite/tests/sm-tests/src/lib.rs index 3a747f93a0a7..a8f2b94d16fc 100644 --- a/rs/ledger_suite/tests/sm-tests/src/lib.rs +++ b/rs/ledger_suite/tests/sm-tests/src/lib.rs @@ -586,16 +586,25 @@ pub fn test_icrc3_supported_block_types( T: CandidType, { let (env, canister_id) = setup(ledger_wasm, encode_init_args, vec![]); + check_icrc3_supported_block_types(&env, canister_id, false); +} +pub fn check_icrc3_supported_block_types( + env: &StateMachine, + canister_id: CanisterId, + supports_107: bool, +) { let mut block_types = vec![]; for supported_block_type in supported_block_types(&env, canister_id) { block_types.push(supported_block_type.block_type); } block_types.sort(); - assert_eq!( - block_types, - vec!["1burn", "1mint", "1xfer", "2approve", "2xfer"] - ); + let mut expected_block_types = vec!["1burn", "1mint", "1xfer", "2approve", "2xfer"]; + if supports_107 { + expected_block_types.push("107feecol"); + expected_block_types.sort(); + } + assert_eq!(block_types, expected_block_types); } pub fn test_total_supply(ledger_wasm: Vec, encode_init_args: fn(InitArgs) -> T) From c5a3c5baa110726026b0d23f0519cdda9a772ed1 Mon Sep 17 00:00:00 2001 From: Maciej Dfinity Date: Tue, 25 Nov 2025 17:48:09 +0000 Subject: [PATCH 4/4] clippy --- rs/ledger_suite/tests/sm-tests/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/ledger_suite/tests/sm-tests/src/lib.rs b/rs/ledger_suite/tests/sm-tests/src/lib.rs index a8f2b94d16fc..8014b8c61c87 100644 --- a/rs/ledger_suite/tests/sm-tests/src/lib.rs +++ b/rs/ledger_suite/tests/sm-tests/src/lib.rs @@ -595,7 +595,7 @@ pub fn check_icrc3_supported_block_types( supports_107: bool, ) { let mut block_types = vec![]; - for supported_block_type in supported_block_types(&env, canister_id) { + for supported_block_type in supported_block_types(env, canister_id) { block_types.push(supported_block_type.block_type); } block_types.sort();