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

Move to cw721 package #161

Merged
merged 47 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2c684b8
rename states: tokens -> nft_info, contract_info -> collection_info
taitruong Feb 27, 2024
c3dc54c
renamed structs and deprecate: TokenInfo -> NftInfo, ContractInfo -> …
taitruong Feb 27, 2024
98b7300
cargo schema
taitruong Feb 27, 2024
5fd2f3b
change storage keys for collection info and nft info, consider in mig…
taitruong Feb 28, 2024
a2b5c12
use PA repo for `cw-ownable`
taitruong Feb 28, 2024
b2f73a0
rename generics and make more readable
taitruong Feb 29, 2024
d46d2b7
CollectionInfoResponse -> CollectionInfo
taitruong Feb 29, 2024
3d101cb
add CollectionInfoExtension with RoyaltyInfo
taitruong Feb 29, 2024
ddc3758
cargo schema
taitruong Feb 29, 2024
18dd4d3
typo
taitruong Feb 29, 2024
917103c
cleanup
taitruong Feb 29, 2024
b3aac9e
rename
taitruong Feb 29, 2024
8d61f85
cargo schema
taitruong Feb 29, 2024
89da1ab
cleanup
taitruong Mar 3, 2024
fcd5159
creator and owner changes:
taitruong Mar 4, 2024
56c6dae
refactor and move key logic to cw721 package:
taitruong Mar 7, 2024
895f462
fix ci
taitruong Mar 7, 2024
920a7d4
cargo fmt
taitruong Mar 7, 2024
641ede9
cargo fmt + clippy
taitruong Mar 7, 2024
0e27df8
cargo fmt
taitruong Mar 7, 2024
8d91900
cargo schema
taitruong Mar 7, 2024
9010cac
cargo clippy
taitruong Mar 7, 2024
bebe8b2
undo: do not rename token keys
taitruong Mar 8, 2024
3d77652
fix unit test
taitruong Mar 8, 2024
6a827a3
remove useless generic `TMetadataResponse`
taitruong Mar 8, 2024
9b8b140
remove response structs to msg.rs
taitruong Mar 8, 2024
ed37215
cargo schema
taitruong Mar 9, 2024
ffa7424
move to dedicated fn
taitruong Mar 9, 2024
5db17ec
docs
taitruong Mar 9, 2024
1e32fac
rename
taitruong Mar 9, 2024
53754d7
cargo clippy
taitruong Apr 25, 2024
dc8a01f
add build script
taitruong Apr 25, 2024
9e06b0b
undo collection info extension and royalty info additions, will be ad…
taitruong Apr 30, 2024
67522f7
cleanup
taitruong May 23, 2024
a5652e2
generate schemas for entry points, cleanup
taitruong Jun 13, 2024
e02c7f9
update rustc 1.65 -> 1.71
taitruong Jun 13, 2024
6b3af84
update cosmwasm version 1.2 -> 1.5, due to rustc compiler issues
taitruong Jun 13, 2024
80a2d17
update optimizer
taitruong Jun 13, 2024
0515aa9
update rustc 1.71 -> 1.78
taitruong Jun 13, 2024
6944bcb
use optimizer
taitruong Jun 13, 2024
f135fe8
formatting
taitruong Jun 13, 2024
61d3693
install rustup first
taitruong Jun 13, 2024
d4ff6e7
set $HOME/.cargo/env
taitruong Jun 13, 2024
e34879f
install libgcc
taitruong Jun 13, 2024
410d11e
install build-base
taitruong Jun 13, 2024
495cccb
cleanup
taitruong Jun 13, 2024
33c7abc
cleanup
taitruong Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 82 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ workflows:
test:
jobs:
- contract_cw721_base
- contract_cw721_metadata_onchain
- contract_cw721_expiration
- contract_cw721_fixed_price
- contract_cw721_receiver_tester
- package_cw721
- lint
- wasm-build
Expand All @@ -21,7 +22,7 @@ workflows:
jobs:
contract_cw721_base:
docker:
- image: rust:1.65.0
- image: rust:1.78.0
working_directory: ~/project/contracts/cw721-base
steps:
- checkout:
Expand All @@ -31,7 +32,31 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw721-base-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-cw721-base-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw721-base-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw721_expiration:
docker:
- image: rust:1.78.0
working_directory: ~/project/contracts/cw721-expiration
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw721-expiration-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -53,12 +78,12 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw721-base-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-cw721-expiration-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw721_metadata_onchain:
contract_cw721_fixed_price:
docker:
- image: rust:1.65.0
working_directory: ~/project/contracts/cw721-metadata-onchain
- image: rust:1.78.0
working_directory: ~/project/contracts/cw721-fixed-price
steps:
- checkout:
path: ~/project
Expand All @@ -67,7 +92,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw721-metadata-onchain-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-cw721-fixed-price-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -89,12 +114,12 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw721-metadata-onchain-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-cw721-fixed-price-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw721_fixed_price:
contract_cw721_receiver_tester:
docker:
- image: rust:1.65.0
working_directory: ~/project/contracts/cw721-fixed-price
- image: rust:1.78.0
working_directory: ~/project/contracts/cw721-receiver-tester
steps:
- checkout:
path: ~/project
Expand All @@ -103,7 +128,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw721-fixed-price-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-cw721-receiver-tester-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -125,11 +150,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw721-fixed-price-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-cw721-receiver-tester-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

package_cw721:
docker:
- image: rust:1.65.0
- image: rust:1.78.0
working_directory: ~/project/packages/cw721
steps:
- checkout:
Expand Down Expand Up @@ -166,15 +191,15 @@ jobs:

lint:
docker:
- image: rust:1.65.0
- image: rust:1.78.0
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-lint-rust:1.65.0-{{ checksum "Cargo.lock" }}
- cargocache-v2-lint-rust:1.78.0-{{ checksum "Cargo.lock" }}
- run:
name: Add rustfmt component
command: rustup component add rustfmt
Expand All @@ -193,47 +218,61 @@ jobs:
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: cargocache-v2-lint-rust:1.65.0-{{ checksum "Cargo.lock" }}
key: cargocache-v2-lint-rust:1.78.0-{{ checksum "Cargo.lock" }}

# This runs one time on the top level to ensure all contracts compile properly into wasm.
# We don't run the wasm build per contract build, and then reuse a lot of the same dependencies, so this speeds up CI time
# for all the other tests.
# We also sanity-check the resultant wasm files.
wasm-build:
docker:
- image: rust:1.65.0
# Image from https://github.com/cibuilds/github, based on alpine
- image: cibuilds/github:0.13
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-wasm-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
name: Install Docker client, rust/cargo libs (build-base)
command: apk add docker-cli build-base
- setup_remote_docker
- checkout
- run:
# We cannot mount local folders, see https://circleci.com/docs/2.0/building-docker-images/#mounting-folders
name: Prepare volume with source code
command: |
# create a dummy container which will hold a volume with config
docker create -v /code --name with_code alpine /bin/true
# copy a config file into this volume
docker cp Cargo.toml with_code:/code
docker cp Cargo.lock with_code:/code
# copy code into this volume
docker cp ./contracts with_code:/code
docker cp ./packages with_code:/code
- run:
name: Add wasm32 target
command: rustup target add wasm32-unknown-unknown
name: Build and optimize contracts
command: |
docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.16.0
docker cp with_code:/code/artifacts ./artifacts
- run:
name: List artifacts and checksums
command: |
ls -l artifacts
cat artifacts/checksums.txt
- run:
name: Build Wasm Release
name: Install Rust and Cargo
command: |
for C in ./contracts/*/
do
echo "Compiling `basename $C`..."
(cd $C && cargo build --release --target wasm32-unknown-unknown --lib --locked)
done
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
rustup target add wasm32-unknown-unknown
- run:
name: Install check_contract
name: Install cosmwasm-check
# Uses --debug for compilation speed
command: cargo install --debug --version 1.1.0 --locked -- cosmwasm-check
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-wasm-rust:1.65.0-{{ checksum "~/project/Cargo.lock" }}
command: |
source $HOME/.cargo/env
cargo install --debug --version 1.1.0 --locked cosmwasm-check
- run:
name: Check wasm contracts
command: cosmwasm-check ./target/wasm32-unknown-unknown/release/*.wasm
command: |
source $HOME/.cargo/env
cosmwasm-check ./artifacts/*.wasm

# This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/
build_and_upload_contracts:
Expand Down Expand Up @@ -261,7 +300,7 @@ jobs:
- run:
name: Build development contracts
command: |
docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.12.13
docker run --volumes-from with_code cosmwasm/workspace-optimizer:0.16.0
docker cp with_code:/code/artifacts ./artifacts
- run:
name: Show data
Expand Down
Loading