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

Fix: Update nns-js candid types #455

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Fix: Update nns-js candid types #455

merged 2 commits into from
Oct 18, 2023

Conversation

lmuntaner
Copy link
Contributor

Motivation

The field is_genesis has been reverted. Therefore, I updated the candid files to the latest commit for nns-js.

Changes

Automatic changes

  • .did files with ./scripts/import-candid.
  • Candid related js and type files with ./scripts/compile-idl-js.

Manual changes

  • Fix converters.

Tests

  • Remove field from neuron mock

Todos

  • Add entry to changelog (if necessary).
    I removed a previous entry.

@lmuntaner lmuntaner requested a review from dskloetd October 18, 2023 07:46
@lmuntaner lmuntaner changed the title Fix lm update nns js Fix: Update nns js Oct 18, 2023
@lmuntaner lmuntaner changed the title Fix: Update nns js Fix: Update nns-js candid types Oct 18, 2023
@lmuntaner
Copy link
Contributor Author

@dskloetd please review

It seems that I had bad luck with the commit I chose in the previous update. The new field was reverted shortly afterwards.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@dfinity/ckbtc 6.79 KB (0%)
@dfinity/cmc 1.01 KB (0%)
@dfinity/ledger-icrc 2.92 KB (0%)
@dfinity/ledger-icp 14.17 KB (0%)
@dfinity/nns 33.74 KB (+0.6% 🔺)
@dfinity/nns-proto 76.3 KB (0%)
@dfinity/sns 14.89 KB (0%)
@dfinity/utils 3.81 KB (0%)
@dfinity/ic-management 1.94 KB (0%)

@dskloetd
Copy link
Collaborator

I see a lot of changes. Way more than just reverting is_genesis.
I think it would be worth installing in nns-dapp locally from path to check if it works (npm run build, npx tsc --noEmit, npm run check).
Then if additional changes are necessary in nns-dapp you can prepare them ready to go.
What do you think?

FYI, I use this script to install ic-js locally. Maybe you can partially reuse it.

set -xe

if [ -z "$1" ]; then
  echo "Specify the path to the ic-js repo." >&2
  exit 1
fi

IC_JS_PATH="$(realpath $1)"

cd frontend
rm -rf node_modules
npm ci

for x in utils ledger-icrc ledger-icp nns-proto nns; do
  npm rm @dfinity/$x && npm i $IC_JS_PATH/packages/$x
done

npm ci

@lmuntaner
Copy link
Contributor Author

I see a lot of changes. Way more than just reverting is_genesis. I think it would be worth installing in nns-dapp locally from path to check if it works (npm run build, npx tsc --noEmit, npm run check). Then if additional changes are necessary in nns-dapp you can prepare them ready to go. What do you think?

Good point, I tested it and all looks good.

Why would I need to test that I need some extra changes in the tests in advance? What's the benefit? As long as it works to fetch and interact with the canister, the rest can easily be done afterwards.

@dskloetd
Copy link
Collaborator

I'm not sure I understand the question. But what I was trying to say is that if it turns out to be complicated to make the changes work in nns-dapp, we want to figure those things out before merging in ic-js so that we don't block other changes or cause breakages for other people trying to upgrade next, while we are still trying to figure out what's wrong.

@lmuntaner
Copy link
Contributor Author

I'm not sure I understand the question. But what I was trying to say is that if it turns out to be complicated to make the changes work in nns-dapp, we want to figure those things out before merging in ic-js so that we don't block other changes or cause breakages for other people trying to upgrade next, while we are still trying to figure out what's wrong.

I'll make those changes right away. I think that should be the default as you mentioned. I already know that there will be changes needed.

Only if we know there won't be changes, then we can leave it withuot upgrading.

@lmuntaner lmuntaner merged commit 90bae93 into main Oct 18, 2023
9 checks passed
@lmuntaner lmuntaner deleted the fix_LM_update-nns-js branch October 18, 2023 08:52
@dskloetd
Copy link
Collaborator

Wait, how can you say it all looks good if there are changes required that you haven't made yet?

@lmuntaner
Copy link
Contributor Author

Because the changes are in the tests. I tested the development server installing nns-js from this branch.

@dskloetd
Copy link
Collaborator

OK, but unless you've already made the changes it's always possible that they turn out to be complicated.
And then someone else tries to upgrade next and runs into these problems and gets stuck.
So I think it's worthwhile to try to have the changes ready before merging in ic-js.

@lmuntaner
Copy link
Contributor Author

OK, but unless you've already made the changes it's always possible that they turn out to be complicated. And then someone else tries to upgrade next and runs into these problems and gets stuck. So I think it's worthwhile to try to have the changes ready before merging in ic-js.

I agree that if it requires changes, they should be done immediately. But just testing them is also not enough. We want a PR to be merged so that another person doesn't get stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants