From 4e829ef540163d5846cdd1340f486912b06945ed Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:04:19 +0100 Subject: [PATCH 01/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index 02621beffe..6f3576ff93 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -1,8 +1,8 @@ name: CI for Nym API Tests -'on': +on: push: paths: - - nym-api/** + - 'nym-api/**' defaults: run: working-directory: nym-api/tests @@ -12,12 +12,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use correct nvm version - run: nvm use v18.1.0 + - name: Use node v18 + uses: actions/setup-node@v3 + with: + node-version: 18.1.0 - name: Install yarn run: yarn install - name: Run yarn run: yarn - name: Run tests - run: 'yarn test:qa' + run: yarn test:qa working-directory: nym-api/tests From 5f7270acc8903d126dc90e38f70ddd5d3eae877b Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:12:37 +0100 Subject: [PATCH 02/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index 6f3576ff93..611f427a58 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -1,25 +1,33 @@ + name: CI for Nym API Tests + on: push: paths: - - 'nym-api/**' + - "nym-api/**" + defaults: run: working-directory: nym-api/tests + jobs: test: name: nym-api tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use node v18 + + - name: Node v18 uses: actions/setup-node@v3 with: node-version: 18.1.0 + - name: Install yarn run: yarn install + - name: Run yarn run: yarn + - name: Run tests - run: yarn test:qa + run: yarn test working-directory: nym-api/tests From 7b7cac505415160cfbb8cca79fc539bb251b0710 Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:15:07 +0100 Subject: [PATCH 03/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index 611f427a58..c54d8ef611 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -1,4 +1,3 @@ - name: CI for Nym API Tests on: From 2dc3999c77594f13ace7db0cb437c7ae2a051b77 Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:20:51 +0100 Subject: [PATCH 04/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index c54d8ef611..48a653f8ab 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -1,6 +1,7 @@ name: CI for Nym API Tests on: + workflow_dispatch: push: paths: - "nym-api/**" From 7c86ef4cbcac5584e8dca4d539d27ca9bb737e65 Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:22:49 +0100 Subject: [PATCH 05/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index 48a653f8ab..c33eebd2d3 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -29,5 +29,5 @@ jobs: run: yarn - name: Run tests - run: yarn test + run: yarn test:qa working-directory: nym-api/tests From 6c6233240988b217899b979bba09f869f5508aa1 Mon Sep 17 00:00:00 2001 From: farbanas Date: Wed, 22 Feb 2023 09:16:19 -0500 Subject: [PATCH 06/10] add workflow dispatch to windows10 build --- .github/workflows/nym-wallet-publish-windows10.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nym-wallet-publish-windows10.yml b/.github/workflows/nym-wallet-publish-windows10.yml index 6f22820943..5eab299f9d 100644 --- a/.github/workflows/nym-wallet-publish-windows10.yml +++ b/.github/workflows/nym-wallet-publish-windows10.yml @@ -1,5 +1,6 @@ name: Publish Nym Wallet (Windows 10) on: + workflow_dispatch: release: types: [created] From fceef1afa623c465dcfba0004f3d938f690c62da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Wed, 22 Feb 2023 15:19:26 +0100 Subject: [PATCH 07/10] nymsphinx: clean up Cargo metadata (#3084) --- common/nymsphinx/Cargo.toml | 6 +----- common/nymsphinx/acknowledgements/Cargo.toml | 6 +----- common/nymsphinx/addressing/Cargo.toml | 6 +----- common/nymsphinx/anonymous-replies/Cargo.toml | 6 +----- common/nymsphinx/chunking/Cargo.toml | 4 +--- common/nymsphinx/cover/Cargo.toml | 6 +----- common/nymsphinx/forwarding/Cargo.toml | 6 +----- common/nymsphinx/framing/Cargo.toml | 6 +----- common/nymsphinx/params/Cargo.toml | 6 +----- common/nymsphinx/types/Cargo.toml | 4 +--- 10 files changed, 10 insertions(+), 46 deletions(-) diff --git a/common/nymsphinx/Cargo.toml b/common/nymsphinx/Cargo.toml index bb738f75d6..d5d10ea633 100644 --- a/common/nymsphinx/Cargo.toml +++ b/common/nymsphinx/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx" version = "0.1.0" +description = "Top-level crate for sphinx packets as used by the Nym mixnet" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] rand = { version = "0.7.3", features = ["wasm-bindgen"] } diff --git a/common/nymsphinx/acknowledgements/Cargo.toml b/common/nymsphinx/acknowledgements/Cargo.toml index 50d41e7bd9..3db7d909db 100644 --- a/common/nymsphinx/acknowledgements/Cargo.toml +++ b/common/nymsphinx/acknowledgements/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-acknowledgements" version = "0.1.0" +description = "Sphinx packet ack messages" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] rand = { version = "0.7.3", features = ["wasm-bindgen"] } diff --git a/common/nymsphinx/addressing/Cargo.toml b/common/nymsphinx/addressing/Cargo.toml index 6b2aae04d4..f9c646e04b 100644 --- a/common/nymsphinx/addressing/Cargo.toml +++ b/common/nymsphinx/addressing/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-addressing" version = "0.1.0" +description = "Nym mixnet addressing" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] nym-crypto = { path = "../../crypto", features = ["asymmetric"] } # all addresses are expressed in terms on their crypto keys diff --git a/common/nymsphinx/anonymous-replies/Cargo.toml b/common/nymsphinx/anonymous-replies/Cargo.toml index c9068d859d..40a6d19308 100644 --- a/common/nymsphinx/anonymous-replies/Cargo.toml +++ b/common/nymsphinx/anonymous-replies/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-anonymous-replies" version = "0.1.0" +description = "Anonymous sphinx packet replies using singly-use-reply-blocks (SURB)" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] rand = { version = "0.7.3", features = ["wasm-bindgen"] } diff --git a/common/nymsphinx/chunking/Cargo.toml b/common/nymsphinx/chunking/Cargo.toml index 2e26f1626f..94bec5886b 100644 --- a/common/nymsphinx/chunking/Cargo.toml +++ b/common/nymsphinx/chunking/Cargo.toml @@ -1,13 +1,11 @@ [package] name = "nym-sphinx-chunking" version = "0.1.0" +description = "Sphinx packet chunking of underlying data packets" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/common/nymsphinx/cover/Cargo.toml b/common/nymsphinx/cover/Cargo.toml index 1e32ff500e..f1558d3676 100644 --- a/common/nymsphinx/cover/Cargo.toml +++ b/common/nymsphinx/cover/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-cover" version = "0.1.0" +description = "Sphinx packets used as cover traffic" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] rand = { version = "0.7.3", features = ["wasm-bindgen"] } diff --git a/common/nymsphinx/forwarding/Cargo.toml b/common/nymsphinx/forwarding/Cargo.toml index bd1a6a830b..e4931b7d8b 100644 --- a/common/nymsphinx/forwarding/Cargo.toml +++ b/common/nymsphinx/forwarding/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-forwarding" version = "0.1.0" +description = "Sphinx packet forwarding as Nym mix packets" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] nym-sphinx-addressing = { path = "../addressing" } diff --git a/common/nymsphinx/framing/Cargo.toml b/common/nymsphinx/framing/Cargo.toml index 90a8e94e5a..b510926555 100644 --- a/common/nymsphinx/framing/Cargo.toml +++ b/common/nymsphinx/framing/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-framing" version = "0.1.0" +description = "Sphinx packet framing for the Nym mixnet" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] bytes = "1.0" diff --git a/common/nymsphinx/params/Cargo.toml b/common/nymsphinx/params/Cargo.toml index 319a55513d..6037bdb333 100644 --- a/common/nymsphinx/params/Cargo.toml +++ b/common/nymsphinx/params/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-sphinx-params" version = "0.1.0" +description = "Sphinx packet parameters for the Nym mixnet" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] thiserror = "1.0.37" diff --git a/common/nymsphinx/types/Cargo.toml b/common/nymsphinx/types/Cargo.toml index 9eaa417b42..53e399ebcf 100644 --- a/common/nymsphinx/types/Cargo.toml +++ b/common/nymsphinx/types/Cargo.toml @@ -1,13 +1,11 @@ [package] name = "nym-sphinx-types" version = "0.1.0" +description = "Re-export sphinx packet types" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } [dependencies] sphinx-packet = { version = "0.1.0" } From 24823356fc71d08e4c2015f1ef03c826501cb28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Wed, 22 Feb 2023 15:55:00 +0100 Subject: [PATCH 08/10] nym-crypto: update nym-sphinx-types dependency to published (#3086) * nym-crypto: update nym-sphinx-types dependency to published * nym-crypto: update cargo metadata --- common/crypto/Cargo.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index b962a26f29..0600adf87d 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -1,15 +1,11 @@ [package] name = "nym-crypto" version = "0.1.0" +description = "Crypto library for the nym mixnet" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -readme = { workspace = true } -homepage = { workspace = true } -documentation = { workspace = true } - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] aes = { version = "0.8.1", optional = true } @@ -30,7 +26,7 @@ subtle-encoding = { version = "0.5", features = ["bech32-preview"]} thiserror = "1.0.37" # internal -nym-sphinx-types = { path = "../nymsphinx/types" } +nym-sphinx-types = { path = "../nymsphinx/types", version = "0.1.0" } nym-pemstore = { path = "../../common/pemstore", version = "0.1.0" } [dev-dependencies] From 2553d633ae6558fe35bec916dc8a4e507f27704f Mon Sep 17 00:00:00 2001 From: benedetta davico <46782255+benedettadavico@users.noreply.github.com> Date: Wed, 22 Feb 2023 16:13:27 +0100 Subject: [PATCH 09/10] Update run-api-tests.yml --- .github/workflows/run-api-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-api-tests.yml b/.github/workflows/run-api-tests.yml index c33eebd2d3..1d2afec2bd 100644 --- a/.github/workflows/run-api-tests.yml +++ b/.github/workflows/run-api-tests.yml @@ -16,7 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - + + - name: Install npm + run: npm install + - name: Node v18 uses: actions/setup-node@v3 with: From e09b2ab7d62670a87200c839c5075dfa2c354b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 22 Feb 2023 15:19:52 +0000 Subject: [PATCH 10/10] reversed the dependency between 'nym-contracts-common' and 'dkg' (#3089) --- Cargo.lock | 2 +- .../contracts-common/Cargo.toml | 1 - .../contracts-common/src/dealings.rs | 16 ---------------- common/dkg/Cargo.toml | 7 ++++++- common/dkg/src/dealing.rs | 18 ++++++++++++++++++ nym-api/Cargo.toml | 4 ++-- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7235f28297..a5ae3d2f08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1601,6 +1601,7 @@ dependencies = [ "ff 0.11.1", "group 0.11.0", "lazy_static", + "nym-contracts-common", "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", @@ -3519,7 +3520,6 @@ version = "0.1.0" dependencies = [ "bs58", "cosmwasm-std", - "dkg", "schemars", "serde", "serde_json", diff --git a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml index 946f0cce90..59042f9a48 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml +++ b/common/cosmwasm-smart-contracts/contracts-common/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" [dependencies] bs58 = "0.4.0" cosmwasm-std = "1.0.0" -dkg = { path = "../../../common/dkg", optional = true } schemars = "0.8" serde = { version = "1.0", features = ["derive"] } thiserror = "1" diff --git a/common/cosmwasm-smart-contracts/contracts-common/src/dealings.rs b/common/cosmwasm-smart-contracts/contracts-common/src/dealings.rs index f28ca85ba2..cfc22e8727 100644 --- a/common/cosmwasm-smart-contracts/contracts-common/src/dealings.rs +++ b/common/cosmwasm-smart-contracts/contracts-common/src/dealings.rs @@ -69,19 +69,3 @@ impl<'de> Deserialize<'de> for ContractSafeBytes { Ok(ContractSafeBytes(bytes)) } } - -#[cfg(feature = "dkg")] -impl<'a> From<&'a Dealing> for ContractSafeBytes { - fn from(dealing: &'a Dealing) -> Self { - ContractSafeBytes(dealing.to_bytes()) - } -} - -#[cfg(feature = "dkg")] -impl<'a> TryFrom<&'a ContractSafeBytes> for Dealing { - type Error = DkgError; - - fn try_from(value: &'a ContractSafeBytes) -> Result { - Dealing::try_from_bytes(&value.0) - } -} diff --git a/common/dkg/Cargo.toml b/common/dkg/Cargo.toml index 33ec03447a..525001f42e 100644 --- a/common/dkg/Cargo.toml +++ b/common/dkg/Cargo.toml @@ -12,9 +12,10 @@ bitvec = "1.0.0" # unfortunately until https://github.com/zkcrypto/bls12_381/issues/10 is resolved, we have to rely on the fork # as we need to be able to serialize Gt so that we could create the lookup table for baby-step-giant-step algorithm bls12_381 = { git = "https://github.com/jstuczyn/bls12_381", branch ="gt-serialisation", default-features = false, features = ["alloc", "pairings", "experimental", "zeroize"] } - +nym-contracts-common = { path = "../cosmwasm-smart-contracts/contracts-common", optional = true } bs58 = "0.4" + lazy_static = "1.4.0" rand = { version = "0.8.5", default-features = false} rand_chacha = "0.3" @@ -41,3 +42,7 @@ criterion = "0.3" [[bench]] name = "benchmarks" harness = false + +[features] +default = [] +cw-types = ["nym-contracts-common"] \ No newline at end of file diff --git a/common/dkg/src/dealing.rs b/common/dkg/src/dealing.rs index d92a9ba6b4..ff31c5736e 100644 --- a/common/dkg/src/dealing.rs +++ b/common/dkg/src/dealing.rs @@ -307,6 +307,24 @@ impl Dealing { } } +#[cfg(feature = "cw-types")] +impl<'a> From<&'a Dealing> for nym_contracts_common::dealings::ContractSafeBytes { + fn from(dealing: &'a Dealing) -> Self { + nym_contracts_common::dealings::ContractSafeBytes(dealing.to_bytes()) + } +} + +#[cfg(feature = "cw-types")] +impl<'a> TryFrom<&'a nym_contracts_common::dealings::ContractSafeBytes> for Dealing { + type Error = DkgError; + + fn try_from( + value: &'a nym_contracts_common::dealings::ContractSafeBytes, + ) -> Result { + Dealing::try_from_bytes(&value.0) + } +} + // this assumes all dealings have been verified pub fn try_recover_verification_keys( dealings: &[Dealing], diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index a1ae9478b5..f64d624708 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -75,12 +75,12 @@ credentials = { path = "../common/credentials" } nym-crypto = { path = "../common/crypto" } cw3 = { version = "0.13.4" } cw4 = { version = "0.13.4" } -dkg = { path = "../common/dkg" } +dkg = { path = "../common/dkg", features = ["cw-types"] } gateway-client = { path = "../common/client-libs/gateway-client" } nym-inclusion-probability = { path = "../common/inclusion-probability" } nym-mixnet-contract-common = { path = "../common/cosmwasm-smart-contracts/mixnet-contract" } nym-vesting-contract-common = { path = "../common/cosmwasm-smart-contracts/vesting-contract" } -nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common", features = ["dkg"] } +nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common" } multisig-contract-common = { path = "../common/cosmwasm-smart-contracts/multisig-contract" } nymcoconut = { path = "../common/nymcoconut" } nym-sphinx = { path = "../common/nymsphinx" }