Skip to content

Commit

Permalink
fix: check-in memo got broken
Browse files Browse the repository at this point in the history
  • Loading branch information
yanliu38 committed Feb 1, 2025
1 parent dcb6886 commit fc21194
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions common/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fc21194

Please sign in to comment.