Skip to content

fix(nns): Use StableBTreeMap::init instead of ::new for voting power snapshots#4877

Merged
jasonz-dfinity merged 2 commits intomasterfrom
jason/govenrance-use-stable-btreemap-init
Apr 24, 2025
Merged

fix(nns): Use StableBTreeMap::init instead of ::new for voting power snapshots#4877
jasonz-dfinity merged 2 commits intomasterfrom
jason/govenrance-use-stable-btreemap-init

Conversation

@jasonz-dfinity
Copy link
Contributor

Why

The StableBTreeMap::new initializes the BTreeMap as an empty map, we'd like the map to be preserved over upgrades.

What

  • Replace StableBTreeMap::new with StableBTreeMap::init

@jasonz-dfinity jasonz-dfinity requested a review from a team as a code owner April 22, 2025 20:43
@github-actions github-actions bot added the fix label Apr 22, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).

To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:

  1. Done.

  2. No canister behavior changes.

@jasonz-dfinity jasonz-dfinity force-pushed the jason/govenrance-use-stable-btreemap-init branch from c3479d3 to 5aca34b Compare April 22, 2025 20:48
@jasonz-dfinity jasonz-dfinity force-pushed the jason/govenrance-use-stable-btreemap-init branch from 5aca34b to 50276bc Compare April 22, 2025 20:49
@jasonz-dfinity jasonz-dfinity changed the base branch from master to changelog-update-2025-04-22 April 22, 2025 20:49
@daniel-wong-dfinity-org
Copy link
Contributor

Yes, this is a pretty confusing part of ic-stable-structures. Sigh.

@jasonz-dfinity jasonz-dfinity force-pushed the jason/govenrance-use-stable-btreemap-init branch from 50276bc to b056c3d Compare April 24, 2025 19:19
@jasonz-dfinity jasonz-dfinity requested a review from a team April 24, 2025 19:19
@jasonz-dfinity jasonz-dfinity requested review from a team as code owners April 24, 2025 19:19
@jasonz-dfinity jasonz-dfinity changed the base branch from changelog-update-2025-04-22 to master April 24, 2025 19:19
@jasonz-dfinity jasonz-dfinity removed the request for review from a team April 24, 2025 19:20
@jasonz-dfinity jasonz-dfinity removed request for a team April 24, 2025 19:20
@jasonz-dfinity jasonz-dfinity added this pull request to the merge queue Apr 24, 2025
Merged via the queue into master with commit 12e0984 Apr 24, 2025
22 checks passed
@jasonz-dfinity jasonz-dfinity deleted the jason/govenrance-use-stable-btreemap-init branch April 24, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants