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

cw1155-base, cw1155-metadata-onchain, cw1155-royalties #2

Open
wants to merge 262 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
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
2b1ba1b
feat: add cw1155-base
ALPAC-4 Aug 17, 2022
26122c8
feat: add cw1155-metadata-onchain
ALPAC-4 Aug 18, 2022
78746b0
feat: add jobs for cw1155
ALPAC-4 Aug 18, 2022
8fe5edb
fix: fix spaceing
ALPAC-4 Aug 18, 2022
b70c8dc
fix: add jobs to test and add package_cw1155
ALPAC-4 Aug 18, 2022
5e3fd48
add schema
ALPAC-4 Aug 18, 2022
753cb6b
fix: add package schema, fix typo
ALPAC-4 Aug 18, 2022
adeb7cf
trivial
dirtyshab Apr 30, 2024
d822a4f
fix: split up transfer event into relevant action events.
dirtyshab May 1, 2024
42a4499
fix: bring back ApprovedForAll and IsApprovedForAll queries (part of …
dirtyshab May 2, 2024
159c79e
Cw1155 Approve/Revoke single (#3)
dirtyshab May 3, 2024
ad05092
refactor: moves cw1155 messages to package, renames messages to close…
dirtyshab May 3, 2024
823639f
fix: mint logic
dirtyshab May 3, 2024
71a1f2a
fix: rename events to be in format *_single and *_batch
dirtyshab May 3, 2024
5875ad0
fix: schema files
dirtyshab May 3, 2024
e107869
feat: implement mint_batch
dirtyshab May 3, 2024
ed56d0a
feat: implements contract_info, minter, and ownership queries.
dirtyshab May 3, 2024
d8e7f76
feat: query all_token_infos
dirtyshab May 4, 2024
0f49674
feat: store and query total supply (sum of all token balances)
dirtyshab May 4, 2024
e42a811
fix: use library feature in cw721-base import
dirtyshab May 6, 2024
b2c060c
fix: store total supply in base instantiate.
dirtyshab May 6, 2024
56e4bc3
fix: cw1155-metadata tests
dirtyshab May 6, 2024
6635fa3
feat: cw1155 on-chain royalties extension
dirtyshab May 6, 2024
00c7b19
fix: existing tests/imports
dirtyshab May 6, 2024
8f9afd2
fix: generic usage
dirtyshab May 6, 2024
c048017
chore: lint
dirtyshab May 6, 2024
be21d01
chore: clippy
dirtyshab May 6, 2024
65ab7d4
fix: lint 2, add circle ci config for cw1155-royalties
dirtyshab May 6, 2024
09f471d
fix: circle ci
dirtyshab May 6, 2024
68960bb
fix: circle ci lint
dirtyshab May 7, 2024
85e5d47
fix: move cosmwasm-schema to deps in metadata extension
dirtyshab May 7, 2024
6f5e9f5
fix: clippy
dirtyshab May 7, 2024
4c7600e
adds custom execute extension and response generics to Cw1155Contract…
dirtyshab May 22, 2024
67522f7
cleanup
taitruong May 23, 2024
c00a913
impl cw_ownable_execute on cw1155.
dirtyshab May 23, 2024
1d3b795
fix: cargo schema
dirtyshab May 23, 2024
32c6e41
fix: cargo schema package
dirtyshab May 23, 2024
cfa0c08
chore: merge queries num_tokens/supply
dirtyshab May 23, 2024
3751bf6
fix query BalanceOfBatch
dirtyshab Jun 5, 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
e48e800
Merge pull request #161 from arkprotocol/move_to_cw721_package
taitruong Jun 27, 2024
3609e4a
make state mod public
dirtyshab Jul 1, 2024
5acfcbf
rename AllBalancesResponse to BalancesResponse and return as response…
dirtyshab Jul 3, 2024
d1e6c9d
remove query AllTokenInfo
dirtyshab Jul 3, 2024
d973780
Fix optimizer call in build.sh
webmaster128 Jul 3, 2024
07105d8
transfer funds along with send/batch_send
dirtyshab Jul 3, 2024
9b241d9
Merge pull request #166 from public-awesome/webmaster128-patch-1
jhernandezb Jul 8, 2024
46136ba
Merge upstream (#4)
dirtyshab Jul 8, 2024
1e1108d
Merge branch 'main' of github.com:CosmWasm/cw-nfts into cw1155
dirtyshab Jul 9, 2024
f142b3b
add more tests
dirtyshab Jul 9, 2024
6328e09
fix typos
normanzb Jul 11, 2024
9dbbc6e
add sender/owner to transfer/mint/burn events
dirtyshab Jul 23, 2024
49d70aa
implement update_metadata() for updating exension/token_uri. not on b…
dirtyshab Jul 23, 2024
e076bd1
clippy
dirtyshab Jul 23, 2024
de3e709
change events to be attributes under wasm like cw721 has
dirtyshab Jul 24, 2024
f0e2812
use same collection key as cw721
dirtyshab Jul 24, 2024
45fc627
zero amount check
dirtyshab Jul 24, 2024
5b88809
use rust version 1.75
dirtyshab Jul 25, 2024
f3d37cb
Merge pull request #167 from normanzb/patch-1
jhernandezb Aug 8, 2024
3ba9341
add Cw2981QueryExtensionMsg for convenience (possibly also to add bac…
dirtyshab Aug 9, 2024
1ac8336
fixes cw2981 extension query msg
dirtyshab Aug 9, 2024
2d0420f
fix cw2981 entry mod
dirtyshab Aug 9, 2024
11d0dc2
Revert "undo collection info extension and royalty info additions, wi…
taitruong Apr 30, 2024
d069c4f
add `TCollectionInfoExtensionMsg` generic, add `Validate` and `Update…
taitruong Mar 11, 2024
df8db83
test minter and creator on init
taitruong Mar 11, 2024
9c5391d
test and validate collection info and collection info extension
taitruong Mar 11, 2024
e6b46e5
cargo schema
taitruong Mar 11, 2024
fe0af64
cleanup
taitruong Mar 11, 2024
9736e6e
test non-creator cannot update collection info
taitruong Mar 11, 2024
337a2a1
cargo schema
taitruong Mar 11, 2024
16a06f3
NEW utilities: UpdateMetadata, validate also metadata on mint
taitruong Mar 12, 2024
174b547
remove cw2981-royalties (covered now in `cw721`)
taitruong Mar 12, 2024
a919c7c
cleanup
taitruong Mar 12, 2024
b7183a0
cleanup
taitruong Mar 12, 2024
fc9291b
cleanup
taitruong Mar 12, 2024
092a8c6
rename
taitruong Mar 12, 2024
13c3a46
rename
taitruong Mar 12, 2024
d164fd3
test update nft metadata
taitruong Mar 12, 2024
08d8e62
allow updating nft token uri
taitruong Mar 12, 2024
0605d93
test update nft info
taitruong Mar 12, 2024
eef4d76
docs
taitruong Mar 13, 2024
ae77d36
cleanup extension query
taitruong Mar 13, 2024
1d0d4f2
cleanup
taitruong Mar 13, 2024
8463beb
add deprecated type
taitruong Mar 13, 2024
afd4290
cleanup
taitruong Mar 13, 2024
9e5803e
validate addr
taitruong Mar 13, 2024
e1b4695
introduce StateFactory
taitruong Mar 14, 2024
c7705e3
cleanup
taitruong Mar 14, 2024
1baf3af
cleanup
taitruong Mar 14, 2024
319974e
cleanup
taitruong Mar 14, 2024
6f16045
move to dedicated traits
taitruong Mar 15, 2024
e979111
add docs
taitruong Mar 15, 2024
ffdb5b9
add Debug trait
taitruong Mar 15, 2024
106bcd1
use references
taitruong Mar 17, 2024
ff8186d
cleanup
taitruong Mar 17, 2024
cfa5cfc
cleanup
taitruong Mar 17, 2024
cdb5742
use references
taitruong Mar 17, 2024
b51da32
use StateFactory for CollectionMetadata
taitruong Mar 18, 2024
a0e549c
move creator assertion to state factory
taitruong Mar 18, 2024
7060109
assert minter for start trading time, all others belongs to creator
taitruong Mar 18, 2024
7efc038
update cw-ownable
taitruong Mar 18, 2024
6729a85
cleanup
taitruong Mar 18, 2024
e56b406
cleanup
taitruong Mar 18, 2024
307f4a4
cleanup
taitruong Mar 18, 2024
68b4fe8
cleanup
taitruong Mar 18, 2024
b65bd58
test creator and minter
taitruong Mar 19, 2024
c375be1
cleanup
taitruong Mar 19, 2024
ce7f7a2
docs
taitruong Mar 19, 2024
f41932e
validate creator and minter in state factory
taitruong Mar 19, 2024
122b23c
test v15 migration
taitruong Mar 19, 2024
f199086
make args optional
taitruong Mar 20, 2024
6b6994b
assert creator and minter only if info is provided
taitruong Mar 20, 2024
0c8c1b9
remove royalty valdation in collection metadata extension, since it i…
taitruong Mar 20, 2024
dee107b
fix validation of nft metadata
taitruong Mar 20, 2024
b3742bc
use StateFactory for Trait
taitruong Mar 20, 2024
fba9f3d
test update unknown NFT
taitruong Mar 20, 2024
11e6c6b
cleanup
taitruong Mar 20, 2024
daf9845
cleanup
taitruong Mar 21, 2024
3e0c1d6
split up into `instantiate_with_version()` and `instantiate()`
taitruong Mar 21, 2024
19f7530
use attributes
taitruong Mar 22, 2024
e85a02b
rename
taitruong Mar 22, 2024
27c07b3
cleanup
taitruong Mar 22, 2024
ee570cb
cleanup
taitruong Mar 22, 2024
e8567b1
move to traits
taitruong Mar 22, 2024
eac094b
cleanup
taitruong Mar 22, 2024
769be6b
cleanup
taitruong Mar 22, 2024
616fb3a
linter
taitruong Mar 22, 2024
3d0cfc4
use option
taitruong Mar 22, 2024
f2757ed
fix royalties
taitruong Mar 23, 2024
36691f3
store royalty info as binary directly
taitruong Mar 23, 2024
3da7c8a
move to contract
taitruong Mar 23, 2024
073c8c0
docs
taitruong Mar 23, 2024
548ba86
docs
taitruong Mar 23, 2024
8b416b0
rename
taitruong Mar 23, 2024
53e5e99
Explicit type equivalent to `Vec<Attribute>`, for better distinction.
taitruong Mar 23, 2024
e221203
cleanup
taitruong Mar 23, 2024
30519cb
add `GetAllInfo` and `GetCollectionExtensionAttributes`
taitruong Mar 23, 2024
17af28d
new `TExtensionQueryMsg` as a distinction for `TNftExtension`
taitruong Mar 24, 2024
281190e
cargo schema
taitruong Mar 24, 2024
542efe0
cleanup
taitruong Mar 24, 2024
17e14da
new `TExtensionMsg` as a distinction for `TNftExtensionMsg`
taitruong Mar 24, 2024
757294d
cargo schema
taitruong Mar 24, 2024
35e9a3b
rate limit query
taitruong Mar 24, 2024
f60a3b9
cargo schema
taitruong Mar 24, 2024
d77a97d
use `ok_or_else()`
taitruong Mar 24, 2024
e47a86a
cargo fmt
taitruong Mar 24, 2024
6b2c668
clippy
taitruong Mar 24, 2024
9c90dd9
docs
taitruong Mar 24, 2024
244ee1a
cleanup
taitruong Mar 26, 2024
62bce32
typo
taitruong Mar 26, 2024
eb2011e
allow setting to None for token uri and optional props in NftExtension
taitruong Mar 27, 2024
cdba342
cargo schema
taitruong Mar 27, 2024
410372e
cargo clippy
taitruong Mar 27, 2024
41e56ce
cleanup docs
taitruong Apr 25, 2024
520f8be
cleanup
taitruong May 6, 2024
f9afff0
make public for re-use
taitruong May 14, 2024
27b1e11
rename Extension -> GetExtension, otherwise there's name clash using …
taitruong May 16, 2024
8ed6ceb
fix: JSON/serde cannot handle nested Options
taitruong Jun 5, 2024
b3960e8
cleanup
taitruong Jun 6, 2024
4aa8e19
update libs
taitruong Jun 6, 2024
ee5a1b1
test mint with empty token uri
taitruong Jun 6, 2024
953fc1d
fix: value for response attribute cannot be empty
taitruong Jun 6, 2024
85e1dd6
Revert "remove cw2981-royalties (covered now in `cw721`)"
taitruong Jul 1, 2024
48c9800
fix cw2981
taitruong Jul 1, 2024
09e293c
cargo schema
taitruong Jul 1, 2024
2111f3a
cleanup
taitruong Jul 1, 2024
d774bf0
fix ci
taitruong Jul 1, 2024
26bd1be
ci: show cosmwasm-version after install
taitruong Jul 1, 2024
45de1c7
install latest cosmwasm-check 2.0.4
taitruong Jul 1, 2024
918a39f
update rust 1.79
taitruong Jul 1, 2024
2adfd4e
switch back to rust 1.78
taitruong Jul 1, 2024
6c2aaff
cw721-metadata-onchain
taitruong Jul 1, 2024
90b914d
cleanup
taitruong Jul 1, 2024
517c136
cargo schema
taitruong Jul 1, 2024
e5d4f27
cleanup
taitruong Jul 1, 2024
fb27cad
cargo schema
taitruong Jul 1, 2024
c53ad51
cleanup
taitruong Jul 1, 2024
807f660
cleanup
taitruong Jul 1, 2024
5ca6d0c
define DefaultCw721Contract, EmptyCw721Contract, and DefaultCw721Expi…
taitruong Jul 1, 2024
eb056f6
cleanup
taitruong Jul 1, 2024
3ed2f18
distinct more clearly for cw721-base being offchain and cw721-metadat…
taitruong Jul 4, 2024
4723981
cleanup
taitruong Jul 4, 2024
7d6e297
move to package and simplify contracts
taitruong Jul 4, 2024
8607b64
cargo schema
taitruong Jul 4, 2024
842d869
cw721-base with no nft extension, but optional collection extension
taitruong Jul 4, 2024
f77d213
cargo schema
taitruong Jul 4, 2024
2bd5cee
cleanup
taitruong Jul 4, 2024
94349da
update reamde
taitruong Jul 8, 2024
8e9966b
readme
taitruong Jul 16, 2024
778b91a
rename
taitruong Jul 24, 2024
a996184
./build-schema.sh
taitruong Jul 24, 2024
9a211ac
allow deprecated
taitruong Aug 11, 2024
8009afb
Merge pull request #156 from arkprotocol/collection-info
taitruong Aug 11, 2024
5ad1237
cleanup
taitruong Aug 11, 2024
459380c
add migrate msgs
taitruong Aug 11, 2024
43e5a4c
add schema
taitruong Aug 11, 2024
1699735
cleanup
taitruong Aug 11, 2024
92ab380
cleanup
taitruong Aug 11, 2024
a25c005
Merge pull request #171 from public-awesome/migrate_msgs
taitruong Aug 13, 2024
df468b2
deps: Option<Deps> -> deps: Deps, env: Option<&Env> -> env: &Env
taitruong Aug 13, 2024
d423d0a
remove build script, since there is `cargo make optimize`
taitruong Aug 13, 2024
6382bda
use bech32 for handling real addresses (e.g. stars1... instead of sim…
taitruong Aug 13, 2024
368c881
clippy
taitruong Aug 13, 2024
5557e79
validate addr
taitruong Aug 13, 2024
bcd8a7c
test invalid addresses
taitruong Aug 13, 2024
71d692b
new GetConfig
taitruong Aug 13, 2024
724e379
rename
taitruong Aug 13, 2024
6b5f3c0
cleanup
taitruong Aug 13, 2024
b5c27c5
schema
taitruong Aug 13, 2024
d733ffb
cleanup
taitruong Aug 13, 2024
83a3cca
cleanup
taitruong Aug 13, 2024
40c9b9e
cleanup
taitruong Aug 13, 2024
a5abe47
Merge pull request #173 from public-awesome/minor_changes
taitruong Aug 14, 2024
501bfcf
adds query OwnersOf - gets balances of owners of a token id, and also…
dirtyshab Aug 16, 2024
76a30e0
error instead of take min when transferring tokens with amount > than…
dirtyshab Aug 16, 2024
76700c1
Merge branch 'main' of github.com:CosmWasm/cw-nfts into cw1155
dirtyshab Aug 23, 2024
58e692b
bump rust version in ci
dirtyshab Aug 23, 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
File renamed without changes.
238 changes: 195 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ workflows:
version: 2
test:
jobs:
- contract_cw1155_base
- contract_cw1155_royalties
- contract_cw721_base
- contract_cw721_metadata_onchain
- contract_cw721_expiration
- contract_cw721_fixed_price
- contract_cw721_receiver_tester
- package_cw721
- package_cw1155
- lint
- wasm-build
deploy:
Expand All @@ -21,7 +25,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 +35,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 +81,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 +95,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 +117,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 +131,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 +153,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 @@ -164,17 +192,126 @@ jobs:
- target
key: cargocache-v2-cw721:1.64.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw1155_base:
docker:
- image: rust:1.78.0
working_directory: ~/project/contracts/cw1155-base
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw1155-base-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
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
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw1155-base-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

contract_cw1155_royalties:
docker:
- image: rust:1.78.0
working_directory: ~/project/contracts/cw1155-royalties
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-cw1155-royalties-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
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
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-cw1155-royalties-rust:1.78.0-{{ checksum "~/project/Cargo.lock" }}

package_cw1155:
docker:
- image: rust:1.78.0
working_directory: ~/project/packages/cw1155
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-cw1155:1.78.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Build library for native target
command: cargo build --locked
- run:
name: Run unit tests
command: cargo test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure schemas are up-to-date
command: |
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
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-cw1155:1.78.0-{{ checksum "~/project/Cargo.lock" }}

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 +330,62 @@ 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:
name: Add wasm32 target
command: rustup target add wasm32-unknown-unknown
# 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: 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 2.0.4 --locked cosmwasm-check
cosmwasm-check --version
- 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 +413,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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ artifacts/
# code coverage
tarpaulin-report.*

# raw json schema files
**/raw/*.json
# json schema files
**/schema/**/*.json
Loading