diff --git a/.github/workflows/rust-fmt-lint.yaml b/.github/workflows/rust-fmt-lint.yaml index 1141e5c0..4a5e5c52 100644 --- a/.github/workflows/rust-fmt-lint.yaml +++ b/.github/workflows/rust-fmt-lint.yaml @@ -13,7 +13,7 @@ on: env: RUST_FMT: nightly-2023-04-01-x86_64-unknown-linux-gnu - RUST_VERSION: 1.67 + RUST_VERSION: 1.72 CARGO_CONCORDIUM_VERSION: "3.2.0" jobs: @@ -29,6 +29,7 @@ jobs: - sponsoredTransactions/backend/Cargo.toml - sponsoredTransactionsAuction/backend/Cargo.toml - trackAndTrace/smart-contract/Cargo.toml + - trackAndTrace/test-scripts/Cargo.toml steps: - name: Checkout @@ -59,6 +60,7 @@ jobs: - sponsoredTransactions/backend/Cargo.toml - sponsoredTransactionsAuction/backend/Cargo.toml - trackAndTrace/smart-contract/Cargo.toml + - trackAndTrace/test-scripts/Cargo.toml steps: - name: Checkout @@ -79,6 +81,29 @@ jobs: command: clippy args: --manifest-path ${{ matrix.crates }} -- -D warnings + build: + name: Build Rust project + # Don't run on draft pull requests + if: ${{ !github.event.pull_request.draft }} + runs-on: ubuntu-latest + strategy: + matrix: + crates: + - trackAndTrace/smart-contract/Cargo.toml + - trackAndTrace/test-scripts/Cargo.toml + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Run cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --manifest-path=${{ matrix.crates }} + test: name: Running tests runs-on: ubuntu-latest diff --git a/trackAndTrace/smart-contract/Cargo.lock b/trackAndTrace/smart-contract/Cargo.lock index b1b6bbdf..e02b1c08 100644 --- a/trackAndTrace/smart-contract/Cargo.lock +++ b/trackAndTrace/smart-contract/Cargo.lock @@ -508,16 +508,6 @@ dependencies = [ "inout", ] -[[package]] -name = "concordium-cis2" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1861ee5cd523b0f1fcca1b2c04919dba79d7d8cf6a325edfc68f228964a3f4d4" -dependencies = [ - "concordium-std", - "primitive-types", -] - [[package]] name = "concordium-contracts-common" version = "9.0.0" @@ -758,12 +748,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -975,15 +959,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "static_assertions", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1693,16 +1668,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "primitive-types" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" -dependencies = [ - "fixed-hash", - "uint", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2098,12 +2063,6 @@ dependencies = [ "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" @@ -2399,7 +2358,6 @@ dependencies = [ name = "track-and-trace" version = "0.1.0" dependencies = [ - "concordium-cis2", "concordium-contracts-common", "concordium-smart-contract-testing", "concordium-std", @@ -2418,18 +2376,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/trackAndTrace/smart-contract/Cargo.toml b/trackAndTrace/smart-contract/Cargo.toml index e2b7e509..121412b5 100644 --- a/trackAndTrace/smart-contract/Cargo.toml +++ b/trackAndTrace/smart-contract/Cargo.toml @@ -8,13 +8,12 @@ description = "A smart contract for tracking and tracing items on a supply chain [features] default = ["std", "wee_alloc"] -std = ["concordium-std/std", "concordium-cis2/std"] +std = ["concordium-std/std"] wee_alloc = ["concordium-std/wee_alloc"] derive-serde = ["concordium-contracts-common/derive-serde", "serde"] [dependencies] concordium-std = { version = "9.0", default-features = false } -concordium-cis2 = { version = "6.0", default-features = false } serde = { version = "1", optional = true, features = ["derive"] } concordium-contracts-common = "9.0.0" diff --git a/trackAndTrace/smart-contract/src/lib.rs b/trackAndTrace/smart-contract/src/lib.rs index 3258f51b..139383b6 100644 --- a/trackAndTrace/smart-contract/src/lib.rs +++ b/trackAndTrace/smart-contract/src/lib.rs @@ -46,8 +46,9 @@ //! ]; //! ``` #![cfg_attr(not(feature = "std"), no_std)] -use concordium_cis2::*; use concordium_std::*; +// Re-export type. +pub use concordium_std::MetadataUrl; /// Event tags. pub const ITEM_CREATED_EVENT_TAG: u8 = 0; diff --git a/trackAndTrace/test-scripts/Cargo.lock b/trackAndTrace/test-scripts/Cargo.lock index af7cb769..64ce8da9 100644 --- a/trackAndTrace/test-scripts/Cargo.lock +++ b/trackAndTrace/test-scripts/Cargo.lock @@ -602,16 +602,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "concordium-cis2" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1861ee5cd523b0f1fcca1b2c04919dba79d7d8cf6a325edfc68f228964a3f4d4" -dependencies = [ - "concordium-std", - "primitive-types", -] - [[package]] name = "concordium-contracts-common" version = "9.0.0" @@ -847,12 +837,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -1064,15 +1048,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "static_assertions", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1785,16 +1760,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "primitive-types" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" -dependencies = [ - "fixed-hash", - "uint", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2295,12 +2260,6 @@ dependencies = [ "der", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" @@ -2622,7 +2581,6 @@ dependencies = [ name = "track-and-trace" version = "0.1.0" dependencies = [ - "concordium-cis2", "concordium-contracts-common", "concordium-std", "serde", @@ -2654,18 +2612,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - [[package]] name = "unicode-ident" version = "1.0.12" diff --git a/trackAndTrace/test-scripts/src/main.rs b/trackAndTrace/test-scripts/src/main.rs index 72b63bd3..ec4f6dc9 100644 --- a/trackAndTrace/test-scripts/src/main.rs +++ b/trackAndTrace/test-scripts/src/main.rs @@ -1,4 +1,3 @@ -use crate::contract_client::MetadataUrl; use anyhow::Context; use clap::Parser as _; use concordium_rust_sdk::{ @@ -13,7 +12,7 @@ use concordium_rust_sdk::{ }, v2::{self as sdk, BlockIdentifier}, }; -use track_and_trace::*; +use track_and_trace::{MetadataUrl, *}; pub enum TrackAndTraceContract {}