Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sns): migrate SNS integration tests / init to sns-gov-api #3918

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anchpop
Copy link
Contributor

@anchpop anchpop commented Feb 12, 2025

Previously, the SNS integration tests and SNS init were using ic-sns-governance. They should be using ic-sns-governance-api. (That they are not using ic-sns-governance-api is a bug waiting to happen.)

Unfortunately this became a very viral change, so the diff is huge. It also involves a lot of code copying, which might not be the ideal approach.

I may close this PR and choose another route forward tomorrow

@anchpop anchpop requested a review from a team as a code owner February 12, 2025 08:27
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.

@anchpop anchpop force-pushed the @anchpop/api-sns-tests branch from 7971a70 to 92b2696 Compare February 12, 2025 16:15
@@ -23,6 +23,7 @@ DEPENDENCIES = [
"//rs/nns/handlers/root/interface",
"//rs/rust_canisters/http_types",
"//rs/sns/governance",
Copy link
Contributor

Choose a reason for hiding this comment

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

are you able to remove the old dependency?

@@ -45,6 +45,7 @@ BASE_DEPENDENCIES = [
"//rs/rust_canisters/dfn_protobuf",
"//rs/rust_canisters/on_wire",
"//rs/sns/governance",
Copy link
Contributor

Choose a reason for hiding this comment

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

same question here

@@ -560,8 +560,7 @@ impl Neuron {
/// that are adopted (then the fees are returned and not owed anymore) or
/// by transferring funds to the neuron's account and then refreshing the stake.
pub fn stake_e8s(&self) -> u64 {
self.cached_neuron_stake_e8s
.saturating_sub(self.neuron_fees_e8s)
ic_sns_governance_api::pb::v1::Neuron::from(self.clone()).stake_e8s()
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like you should have this implementation inside the domain model - not use the API version

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