diff --git a/.github/workflows/contract_tests.yml b/.github/workflows/contract_tests.yml new file mode 100644 index 000000000..7add6c16f --- /dev/null +++ b/.github/workflows/contract_tests.yml @@ -0,0 +1,78 @@ +name: Contract Tests + +on: + push: + branches: + - main + - 0.[0-9]+ + pull_request: + +jobs: + contract_build_and_test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + contract: [burner, crypto-verify, cyberpunk, hackatom, ibc-reflect, ibc-reflect-send, queue, query-queue, reflect, floaty, staking, voting-with-uuid] + env: + working-directory: ./contracts/${{ matrix.contract }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.60.0 + target: wasm32-unknown-unknown + profile: minimal + override: true + components: rustfmt, clippy + - name: Cache cargo + uses: actions/cache@v4 + with: + path: ~/.cargo + key: cargocache-v2-${{ matrix.contract }}-rust:1.60.0-${{ hashFiles(format('contracts/{0}/Cargo.lock', matrix.contract)) }} + - name: Version information + run: rustc --version; cargo --version; rustup --version; rustup target list --installed + - name: Add wasm32 target + run: rustup target add wasm32-unknown-unknown && rustup target list --installed + - name: Build wasm binary + working-directory: ${{env.working-directory}} + run: cargo wasm --locked + - name: Unit tests + working-directory: ${{env.working-directory}} + run: cargo unit-test --locked + # + # If this contract requires other contracts for integration testing, please compile it here + # + - name: Build queue wasm binary for integration tests (query-queue) + if: matrix.contract == 'query-queue' + working-directory: ./contracts/queue + run: cargo wasm --locked + # + # Finish + # + - name: Integration tests (singlepass backend) + working-directory: ${{env.working-directory}} + run: cargo test --test integration --locked --no-default-features + - name: Documentation tests + working-directory: ${{env.working-directory}} + run: cargo test --doc --locked + - name: Build and run schema generator + working-directory: ${{env.working-directory}} + run: cargo schema --locked + - name: Ensure schemas are up-to-date + working-directory: ${{env.working-directory}} + run: | + CHANGES_IN_REPO=$(git status --porcelain) + if [[ -n "$CHANGES_IN_REPO" ]]; then + echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" + git status && git --no-pager diff + exit 1 + fi + - name: Check formatting + working-directory: ${{env.working-directory}} + run: cargo fmt -- --check + - name: Clippy linting + working-directory: ${{env.working-directory}} + run: cargo clippy --tests -- -D warnings diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5544c9486..474b119ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_crypto-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -53,7 +53,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_derive-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -82,7 +82,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_schema-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -111,7 +111,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_std-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -165,7 +165,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_storage-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -197,7 +197,7 @@ jobs: profile: minimal override: true - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo key: cargocache-v2-package_vm-rust:1.60.0-${{ hashFiles('Cargo.lock') }} @@ -216,478 +216,14 @@ jobs: working-directory: ${{env.working-directory}} run: cargo test --locked --features iterator,staking,stargate - contract_burner: - name: contract_burner + clippy-and-fmt: + name: clippy-and-fmt runs-on: ubuntu-latest env: - working-directory: ./contracts/burner - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_burner-rust:1.60.0-${{ hashFiles('contracts/burner/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_crypto_verify: - name: contract_crypto_verify - runs-on: ubuntu-latest - env: - working-directory: ./contracts/crypto-verify - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_crypto_verify-rust:1.60.0-${{ hashFiles('contracts/crypto-verify/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_hackatom: - name: contract_hackatom - runs-on: ubuntu-latest - env: - working-directory: ./contracts/hackatom - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_hackatom-rust:1.60.0-${{ hashFiles('contracts/hackatom/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_ibc_reflect: - name: contract_ibc_reflect - runs-on: ubuntu-latest - env: - working-directory: ./contracts/ibc-reflect - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_ibc_reflect-rust:1.60.0-${{ hashFiles('contracts/ibc-reflect/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_ibc_reflect_send: - name: contract_ibc_reflect_send - runs-on: ubuntu-latest - env: - working-directory: ./contracts/ibc-reflect-send - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_ibc_reflect_send-rust:1.60.0-${{ hashFiles('contracts/ibc-reflect-send/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_queue: - name: contract_queue - runs-on: ubuntu-latest - env: - working-directory: ./contracts/queue - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_queue-rust:1.60.0-${{ hashFiles('contracts/queue/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_query_queue: - name: contract_query_queue - runs-on: ubuntu-latest - env: - working-directory: ./contracts/query-queue - queue-directory: ./contracts/queue - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_query_queue-rust:1.60.0-${{ hashFiles('contracts/queue/Cargo.lock', 'contracts/query-queue/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Build queue wasm binary for integration tests - working-directory: ${{env.queue-directory}} - run: cargo wasm --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_reflect: - name: contract_reflect - runs-on: ubuntu-latest - env: - working-directory: ./contracts/reflect - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_reflect-rust:1.60.0-${{ hashFiles('contracts/reflect/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_staking: - name: contract_staking - runs-on: ubuntu-latest - env: - working-directory: ./contracts/staking - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_staking-rust:1.60.0-${{ hashFiles('contracts/staking/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - contract_voting_with_uuid: - name: contract_voting_with_uuid - runs-on: ubuntu-latest - env: - working-directory: ./contracts/voting-with-uuid - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-contract_staking-rust:1.60.0-${{ hashFiles('contracts/voting-with-uuid/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add wasm32 target - run: rustup target add wasm32-unknown-unknown && rustup target list --installed - - name: Build wasm binary - working-directory: ${{env.working-directory}} - run: cargo wasm --locked - - name: Unit tests - working-directory: ${{env.working-directory}} - run: cargo unit-test --locked - - name: Integration tests (singlepass backend) - working-directory: ${{env.working-directory}} - run: cargo integration-test-for-ci --locked --no-default-features - - name: Build and run schema generator - working-directory: ${{env.working-directory}} - run: cargo schema --locked - - name: Ensure schemas are up-to-date - working-directory: ${{env.working-directory}} - run: | - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi - - fmt: - name: fmt - runs-on: ubuntu-latest - env: - root-directory: ./contracts + packages: ./packages steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -695,69 +231,18 @@ jobs: target: wasm32-unknown-unknown profile: minimal override: true + components: rustfmt, clippy - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo - key: cargocache-v2-fmt-rust:1.60.0-${{ hashFiles('Cargo.lock', 'contracts/*/Cargo.lock') }} + key: cargocache-v2-fmt-rust:1.60.0-${{ hashFiles('Cargo.lock') }} - name: Version information run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add rustfmt component - run: rustup component add rustfmt - name: Check formatting of workspace run: cargo fmt -- --check - - name: Check formatting of contract burner - working-directory: ${{env.root-directory}}/burner - run: cargo fmt -- --check - - name: Check formatting of contract crypto-verify - working-directory: ${{env.root-directory}}/crypto-verify - run: cargo fmt -- --check - - name: Check formatting of contract hackatom - working-directory: ${{env.root-directory}}/hackatom - run: cargo fmt -- --check - - name: Check formatting of contract reflect - working-directory: ${{env.root-directory}}/reflect - run: cargo fmt -- --check - - name: Check formatting of contract queue - working-directory: ${{env.root-directory}}/queue - run: cargo fmt -- --check - - name: Check formatting of contract query-queue - working-directory: ${{env.root-directory}}/query-queue - run: cargo fmt -- --check - - name: Check formatting of contract staking - working-directory: ${{env.root-directory}}/staking - run: cargo fmt -- --check - - name: Check formatting of contract voting-with-uuid - working-directory: ${{env.root-directory}}/voting-with-uuid - run: cargo fmt -- --check - - clippy: - name: clippy - runs-on: ubuntu-latest - env: - packages: ./packages - contracts: ./contracts - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - target: wasm32-unknown-unknown - profile: minimal - override: true - - name: Cache cargo - uses: actions/cache@v3 - with: - path: ~/.cargo - key: cargocache-v2-clippy-rust:1.60.0-${{ hashFiles('Cargo.lock', 'contracts/*/Cargo.lock') }} - - name: Version information - run: rustc --version; cargo --version; rustup --version; rustup target list --installed - - name: Add clippy component - run: rustup component add clippy # - # Workspace packages + # Check clippy linting on Workspace packages # - name: Clippy linting on schema working-directory: ${{env.packages}}/schema @@ -780,66 +265,3 @@ jobs: - name: Clippy linting on vm (all feature flags) working-directory: ${{env.packages}}/vm run: cargo clippy --features iterator,staking,stargate -- -D warnings - # - # Contracts - # - - name: Clippy linting on burner - working-directory: ${{env.contracts}}/burner - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/burner.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on crypto-verify - working-directory: ${{env.contracts}}/crypto-verify - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/crypto_verify.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on hackatom - working-directory: ${{env.contracts}}/hackatom - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/hackatom.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on ibc-reflect - working-directory: ${{env.contracts}}/ibc-reflect - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/ibc_reflect.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on ibc-reflect-send - working-directory: ${{env.contracts}}/ibc-reflect-send - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/ibc_reflect_send.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on queue - working-directory: ${{env.contracts}}/queue - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/queue.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on query-queue - working-directory: ${{env.contracts}}/query-queue - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/query_queue.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on reflect - working-directory: ${{env.contracts}}/reflect - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/reflect.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on staking - working-directory: ${{env.contracts}}/staking - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/staking.wasm - cargo clippy --tests -- -D warnings - - name: Clippy linting on voting-with-uuid - working-directory: ${{env.contracts}}/voting-with-uuid - run: | - mkdir -p target/wasm32-unknown-unknown/release - touch target/wasm32-unknown-unknown/release/cw_voting_with_uuid.wasm - cargo clippy --tests -- -D warnings diff --git a/contracts/cyberpunk/schema/cyberpunk.json b/contracts/cyberpunk/schema/cyberpunk.json index 9439d3055..b01599cb7 100644 --- a/contracts/cyberpunk/schema/cyberpunk.json +++ b/contracts/cyberpunk/schema/cyberpunk.json @@ -133,7 +133,7 @@ "minimum": 0.0 }, "time": { - "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time in Tendermint](https://github.com/tendermint/tendermint/blob/58dc1726/spec/consensus/bft-time.md), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", + "description": "Absolute time of the block creation in seconds since the UNIX epoch (00:00:00 on 1970-01-01 UTC).\n\nThe source of this is the [BFT Time](https://github.com/Finschia/ostracon/blob/main/spec/README.md#consensus-protocol), which has the same nanosecond precision as the `Timestamp` type.\n\n# Examples\n\nUsing chrono:\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; # extern crate chrono; use chrono::NaiveDateTime; let seconds = env.block.time.seconds(); let nsecs = env.block.time.subsec_nanos(); let dt = NaiveDateTime::from_timestamp(seconds as i64, nsecs as u32); ```\n\nCreating a simple millisecond-precision timestamp (as used in JavaScript):\n\n``` # use cosmwasm_std::{Addr, BlockInfo, ContractInfo, Env, MessageInfo, Timestamp, TransactionInfo}; # let env = Env { # block: BlockInfo { # height: 12_345, # time: Timestamp::from_nanos(1_571_797_419_879_305_533), # chain_id: \"cosmos-testnet-14002\".to_string(), # }, # transaction: Some(TransactionInfo { index: 3 }), # contract: ContractInfo { # address: Addr::unchecked(\"contract\"), # }, # }; let millis = env.block.time.nanos() / 1_000_000; ```", "allOf": [ { "$ref": "#/definitions/Timestamp"