-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: cargo scripts, workspace optimize and oracle contract
- Loading branch information
Showing
27 changed files
with
157 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
node_modules | ||
target | ||
# Build results | ||
/target | ||
/artifacts | ||
# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) | ||
.cargo-ok | ||
|
||
# Text file backups | ||
**/*.rs.bk | ||
|
||
# macOS | ||
.DS_Store | ||
|
||
# IDEs | ||
*.iml | ||
.idea |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[config] | ||
# Set this to `false` to run the tasks at workspace root directory and not on the members | ||
default_to_workspace = false | ||
# Set this to `true` to avoid clashes with core commands (e.g. `cargo make publish` vs `cargo publish`) | ||
skip_core_tasks = true | ||
|
||
[tasks.fmt] | ||
command = "cargo" | ||
args = ["fmt", "--all", "--check"] | ||
|
||
[tasks.test] | ||
command = "cargo" | ||
args = ["test", "--locked"] | ||
|
||
[tasks.lint] | ||
command = "cargo" | ||
args = ["clippy", "--tests", "--", "-D", "warnings"] | ||
|
||
[tasks.build] | ||
command = "cargo" | ||
args = [ | ||
"build", | ||
"--release", | ||
"--locked", | ||
"--target", "wasm32-unknown-unknown", | ||
] | ||
|
||
[tasks.optimize] | ||
script = """ | ||
if [[ $(arch) == "arm64" ]]; then | ||
image="cosmwasm/workspace-optimizer-arm64" | ||
else | ||
image="cosmwasm/workspace-optimizer" | ||
fi | ||
docker run --rm -v "$(pwd)":/code \ | ||
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
${image}:0.12.12 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Development | ||
|
||
Considering the Rust is installed in your system you have to use the wasm32 compiler and install cargo-make. | ||
|
||
```sh | ||
$ rustup default stable | ||
$ rustup target add wasm32-unknown-unknown | ||
$ cargo install --force cargo-make | ||
``` | ||
|
||
There are few available commands to run on development: | ||
|
||
Validate the code has been formatted correctly: | ||
```sh | ||
$ cargo make fmt | ||
``` | ||
|
||
Run the tests written for the smart contracts | ||
```sh | ||
$ cargo make test | ||
``` | ||
|
||
Lint the code | ||
```sh | ||
$ cargo make lint | ||
``` | ||
|
||
Build the code | ||
```sh | ||
$ cargo make build | ||
``` | ||
|
||
Optimize the built code | ||
```sh | ||
$ cargo make optimize | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,16 @@ authors = ["Terra Money <[email protected]>"] | |
edition = "2018" | ||
|
||
exclude = [ | ||
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication. | ||
"contract.wasm", | ||
"hash.txt", | ||
] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
backtraces = ["cosmwasm-std/backtraces"] | ||
library = [] | ||
|
||
[dependencies] | ||
cosmwasm-std = { workspace = true } | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.