From fc21194069ff9dcbf2db23c16546337429f04c8d Mon Sep 17 00:00:00 2001 From: Yan Liu Date: Sat, 1 Feb 2025 01:28:00 +0100 Subject: [PATCH] fix: check-in memo got broken --- common/src/rewards.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/common/src/rewards.rs b/common/src/rewards.rs index 59dc446..a1c955d 100644 --- a/common/src/rewards.rs +++ b/common/src/rewards.rs @@ -246,21 +246,23 @@ pub fn do_node_provider_check_in( amount_as_string(amount as TokenAmountE9s), dcc_id.to_ic_principal() ); + let mut fee_memo = format!( + "check-in-{}-{}-{}", + dcc_id + .to_ic_principal() + .to_text() + .split_once('-') + .expect("Invalid principal") + .0, + ledger.get_blocks_count(), + memo + ); + fee_memo.truncate(MEMO_BYTES_MAX); charge_fees_to_account_no_bump_reputation( ledger, &dcc_id, amount as TokenAmountE9s, - &format!( - "check-in-{}-{}-{}", - dcc_id - .to_ic_principal() - .to_text() - .split_once('-') - .expect("Invalid principal") - .0, - ledger.get_blocks_count(), - memo - )[..MEMO_BYTES_MAX], + &fee_memo, )?; amount } else {