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/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..8014b8c61c87 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) { + 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)