Skip to content

Commit

Permalink
Merge pull request #126 from okp4/feat/storage-pin-object
Browse files Browse the repository at this point in the history
💿 Storage: Pin / Unpin object
  • Loading branch information
bdeneux committed Mar 9, 2023
2 parents 402dff7 + 57327db commit df7196a
Show file tree
Hide file tree
Showing 6 changed files with 689 additions and 34 deletions.
42 changes: 40 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ description = "Run all unit tests."
env = { LLVM_PROFILE_FILE = "default.profraw", RUST_BACKTRACE = 1 }

[tasks.test-coverage]
dependencies = ["install-tarpaulin"]
command = "cargo"
args = ["tarpaulin", "-o", "lcov"]
command = "cargo"
dependencies = ["install-tarpaulin"]

[tasks.install_wasm]
script = '''
Expand Down Expand Up @@ -430,6 +430,44 @@ docker run --rm \
| jq -r '.'
'''

[tasks.chain-execute-contract]
dependencies = ["chain-start"]
description = "Execute a command on a specific contract to the chain. The contract must be already deployed and instantiated."
script = '''
if [ -z "$1" ]
then
echo "❌ Please provide the contract address as the first argument."
exit 1
fi
addr=$1
if [ -z "$2" ]
then
echo "❌ Please provide the contract execute msg as the second argument."
exit 1
fi
msgs=$2
echo "📦 Execute on contract ${addr} to chain ${CHAIN}"
docker run --rm \
--network host \
-v `pwd`:/app:ro \
-w /app \
${DOCKER_IMAGE_OKP4D} \
tx wasm execute ${addr} "${msgs}" \
--from validator \
--keyring-backend test \
--home ${CHAIN_HOME} \
--gas-prices 0.025uknow \
--gas auto \
--gas-adjustment 1.5 \
--chain-id ${CHAIN} \
--broadcast-mode block \
--yes \
--output json \
| jq -r '.'
'''

[tasks.install-llvm-tools-preview]
install_crate = { rustup_component_name = "llvm-tools-preview" }

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ chain-add-keys - Add a set of predefined keys (recovered from the seed phrases)
chain-clean - Clean the chain data (⚠️ definitively)
chain-deploy-contract - Deploy a specific contract to the chain. The contract must be compiled and the wasm file must be present in the artifacts directory (under target/wasm32-unknown-unknown/...).
chain-deploy-contracts - Deploy all the available contracts to the chain (under target/wasm32-unknown-unknown/...).
chain-execute-contract - Execute a command on a specific contract to the chain. The contract must be already deployed and instantiated.
chain-init-folder - Initialize deploy folder to make sure scripts have the right permission (needed for linux)
chain-initialize - Initialize the chain with a validator's key and a set of predefined keys. ⚠️ The home directory is cleaned before.
chain-inspect-contract - Inspect a specific contract deployed to the chain.
Expand Down
6 changes: 3 additions & 3 deletions contracts/cw-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ panic = 'abort'
rpath = false

[dependencies]
base16ct = "0.1.1"
cosmwasm-schema.workspace = true
cosmwasm-std.workspace = true
cosmwasm-storage.workspace = true
cw-storage-plus.workspace = true
cw2.workspace = true
schemars.workspace = true
serde.workspace = true
thiserror.workspace = true
sha2 = "0.10.6"
base16ct = "0.1.1"
thiserror.workspace = true

[dev-dependencies]
cw-multi-test.workspace = true
base64 = "0.21.0"
cw-multi-test.workspace = true

[features]
# for more explicit tests, cargo test --features=backtraces
Expand Down
Loading

0 comments on commit df7196a

Please sign in to comment.