Skip to content

Commit

Permalink
fixup! Merge branch 'murisi/masp-test-vectors-rebased' (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Jan 24, 2024
1 parent e81948d commit ecf2089
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/shielded_token/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,10 @@ where
let ref_inflation =
calculate_masp_rewards_precision(wl_storage, &native_token)?.0;

if !masp_reward_keys.contains(&native_token) {
// Since MASP rewards are denominated in NAM tokens, ensure that clients
// are able to decode them.
masp_reward_keys.push(native_token.clone());
}

// Reward all tokens according to above reward rates
for addr in &masp_reward_keys {
let (reward, denom) = calculate_masp_rewards(wl_storage, addr)?;
masp_reward_denoms.insert(addr, denom);
masp_reward_denoms.insert(addr.clone(), denom);
// Dispense a transparent reward in parallel to the shielded rewards
let addr_bal: Amount = wl_storage
.read(&balance_key(addr, &masp_addr))?
Expand Down Expand Up @@ -501,6 +495,11 @@ where
),
)?;

if !masp_reward_keys.contains(&native_token) {
// Since MASP rewards are denominated in NAM tokens, ensure that clients
// are able to decode them.
masp_reward_keys.push(native_token.clone());
}
// Add purely decoding entries to the assets map. These will be
// overwritten before the creation of the next commitment tree
for (addr, denom) in masp_reward_denoms {
Expand Down

0 comments on commit ecf2089

Please sign in to comment.