Skip to content

Commit

Permalink
chore: update replica rev / SNS version (#164)
Browse files Browse the repository at this point in the history
* fix: obtain extension version even on branch on a fork

workspace_members can contain something like path+file:///Users/ericswanson/fork/anchpop/dfx-extensions/extensions/nns#0.4.7

Instead, get the version directly from the package

* chore: Update replica rev

---------

Co-authored-by: Eric Swanson <[email protected]>
Co-authored-by: anchpop <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2025
1 parent bd46410 commit eece457
Show file tree
Hide file tree
Showing 12 changed files with 733 additions and 588 deletions.
1,278 changes: 707 additions & 571 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "Apache-2.0"
repository = "https://github.com/dfinity/dfx-extensions"

[workspace.dependencies]
dfx-core = "0.1.1"
dfx-core = "0.1.2"
dfx-extensions-utils.path = "./extensions-utils"

anyhow = "^1"
Expand All @@ -21,8 +21,8 @@ flate2 = { version = "1.0.25", default-features = false, features = [
] }
fn-error-context = "0.2.1"
futures-util = "0.3.28"
ic-agent = "=0.38.0"
ic-utils = "=0.38.0"
ic-agent = "0.39"
ic-utils = "0.39"
pocket-ic = "6.0.0"
reqwest = { version = "^0.11.22", default-features = false, features = [
"blocking",
Expand All @@ -35,11 +35,11 @@ slog = "^2.7.0"
tempfile = "3.12.0"
tokio = { version = "^1.36.0", features = ["rt-multi-thread"] }
url = "^2.4.1"
ic-http-utils = { git = "https://github.com/dfinity/ic", rev = "0f96a6f4661f0d87bd9149a88846db9674360291" }
ic-icp-index = { git = "https://github.com/dfinity/ic", rev = "0f96a6f4661f0d87bd9149a88846db9674360291" }
ic-icrc1-index-ng = { git = "https://github.com/dfinity/ic", rev = "0f96a6f4661f0d87bd9149a88846db9674360291" }
ic-icrc1-ledger = { git = "https://github.com/dfinity/ic", rev = "0f96a6f4661f0d87bd9149a88846db9674360291" }
ic-sns-cli = { git = "https://github.com/dfinity/ic", rev = "0f96a6f4661f0d87bd9149a88846db9674360291" }
ic-http-utils = { git = "https://github.com/dfinity/ic", rev = "760e1f764b56f4f655a09789c245da487eccc5cb" }
ic-icp-index = { git = "https://github.com/dfinity/ic", rev = "760e1f764b56f4f655a09789c245da487eccc5cb" }
ic-icrc1-index-ng = { git = "https://github.com/dfinity/ic", rev = "760e1f764b56f4f655a09789c245da487eccc5cb" }
ic-icrc1-ledger = { git = "https://github.com/dfinity/ic", rev = "760e1f764b56f4f655a09789c245da487eccc5cb" }
ic-sns-cli = { git = "https://github.com/dfinity/ic", rev = "760e1f764b56f4f655a09789c245da487eccc5cb" }
serde_json = "1.0.79"

# Config for 'cargo dist'
Expand Down
4 changes: 2 additions & 2 deletions extensions-utils/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn generate_args(cmd: &clap::Command) -> BTreeMap<String, ExtensionSubcommandArg
if min == 0 && max == usize::MAX {
ArgNumberOfValues::Unlimited
} else if min == max {
ArgNumberOfValues::Number(min as usize)
ArgNumberOfValues::Number(min)
} else {
// max is inclusive, but ArgNumberOfValues::Range wants an exclusive range
ArgNumberOfValues::Range(min..(max.saturating_add(1)))
Expand All @@ -76,7 +76,7 @@ fn generate_args(cmd: &clap::Command) -> BTreeMap<String, ExtensionSubcommandArg
}

pub fn verify_extension_manifest<Command: clap::CommandFactory>(path: &Path) -> anyhow::Result<()> {
// read the mainfest from the path and deserizlize it
// read the manifest from the path and deserialize it
let current_manifest_string = std::fs::read_to_string(path).context(format!(
"Could not read the extension manifest at {}",
path.display(),
Expand Down
2 changes: 1 addition & 1 deletion extensions/nns/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::path::PathBuf;

const REPLICA_REV: &str = "0f96a6f4661f0d87bd9149a88846db9674360291";
const REPLICA_REV: &str = "760e1f764b56f4f655a09789c245da487eccc5cb";

const BINARY_DEPENDENCIES: &[(&str, &str)] = &[
// (downloaded binary name, renamed binary name)
Expand Down
2 changes: 1 addition & 1 deletion extensions/nns/src/install_nns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub async fn install_nns(
networks_config: &NetworksConfig,
dfx_cache_path: &Path,
ledger_accounts: &[String],
logger: &Logger,
_logger: &Logger,
) -> anyhow::Result<()> {
eprintln!("Checking out the environment...");
// Retrieve the PocketIC instance topology.
Expand Down
6 changes: 5 additions & 1 deletion extensions/sns/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<!-- next-header -->

## [Unreleased] - ReleaseDate
- Fixed a bug where `dfx sns import` would fail if a canister type in dfx.json was defined by an extension.
- Improved the behavior of SNS Testflight. There is currently an incompatibilty between the `sns-init.yaml` format and SNS Testflight. [Refer to this forum post](https://forum.dfinity.org/t/error-when-deploying-sns-testflight-to-mainnet/38282/6?u=andre-popovitch) for more information and workarounds.

## [0.4.8] - 2024-12-16

## [0.4.7] - 2024-11-08
- Fixed a bug where `dfx sns import` would fail if a canister type in dfx.json was defined by an extension.
- Added support for `dfx start --pocketic`.

## [0.4.6] - 2024-10-11
Expand Down Expand Up @@ -64,6 +67,7 @@

<!-- next-url -->
[Unreleased]: https://github.com/dfinity/dfx-extensions/compare/{{tag_name}}...HEAD
[0.4.8]: https://github.com/dfinity/dfx-extensions/compare/{{tag_name}}...{{tag_name}}
[0.4.7]: https://github.com/dfinity/dfx-extensions/compare/{{tag_name}}...{{tag_name}}
[0.4.6]: https://github.com/dfinity/dfx-extensions/compare/{{tag_name}}...{{tag_name}}
[0.4.5]: https://github.com/dfinity/dfx-extensions/compare/{{tag_name}}...{{tag_name}}
Expand Down
2 changes: 1 addition & 1 deletion extensions/sns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ anyhow.workspace = true
clap.workspace = true
fn-error-context.workspace = true
slog.workspace = true
ic-agent = "0.37"
ic-agent.workspace = true
tokio.workspace = true
futures-util = "0.3.28"
candid.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion extensions/sns/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::env;
use std::path::PathBuf;

const REPLICA_REV: &str = "0f96a6f4661f0d87bd9149a88846db9674360291";
const REPLICA_REV: &str = "760e1f764b56f4f655a09789c245da487eccc5cb";

const BINARY_DEPENDENCIES: &[(&str, &str)] = &[
// (downloaded binary name, renamed binary name)
Expand Down
5 changes: 5 additions & 0 deletions extensions/sns/dependencies.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"0.4.8": {
"dfx": {
"version": ">=0.17.0"
}
},
"0.4.7": {
"dfx": {
"version": ">=0.17.0"
Expand Down
1 change: 0 additions & 1 deletion extensions/sns/src/commands/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use dfx_extensions_utils::replica_rev;

use clap::Parser;
use std::path::{Path, PathBuf};
use tokio::runtime::Runtime;

/// Downloads the SNS canister WASMs
#[derive(Parser)]
Expand Down
1 change: 1 addition & 0 deletions extensions/sns/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async fn main() -> anyhow::Result<()> {
}

#[test]
#[ignore] // TODO: remove once a dfx-core release containing <https://github.com/dfinity/sdk/pull/4060> is merged and this repo is updated to use that version.
fn verify_extension_manifest() {
let project_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
println!("Project root: {:?}", project_root);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.76.0"
channel = "1.83.0"
components = ["rustfmt", "clippy"]

0 comments on commit eece457

Please sign in to comment.