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

ci: add just recipes for deploying and store contracts #276

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

kerber0x
Copy link
Contributor

@kerber0x kerber0x commented Feb 7, 2024

Description and Motivation

This PR adds just recipes for deploy and store artifacts on chain.

Related Issues


Checklist:

  • I have read Migaloo's contribution guidelines.
  • My pull request has a sound title and description (not something vague like Update index.md)
  • All existing and new tests are passing.
  • I updated/added relevant documentation.
  • The code is formatted properly cargo fmt --all --.
  • Clippy doesn't report any issues cargo clippy -- -D warnings.
  • I have regenerated the schemas if needed cargo schema.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fbf3fa6) 94.46% compared to head (da55e32) 94.45%.

❗ Current head da55e32 differs from pull request most recent head 7676a96. Consider uploading reports for the commit 7676a96 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #276      +/-   ##
==========================================
- Coverage   94.46%   94.45%   -0.02%     
==========================================
  Files         219      219              
  Lines       24858    24862       +4     
==========================================
+ Hits        23482    23483       +1     
- Misses       1376     1379       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

local code_id=$(echo $res | jq -r '.logs[0].events[] | select(.type == "store_code").attributes[] | select(.key == "code_id").value')
local res=$($BINARY tx wasm store $artifact $TXFLAG --from $deployer | jq -r '.txhash')
sleep $tx_delay
local code_id=$($BINARY q tx $res --node $RPC -o json | jq -r '.logs[0].events[] | select(.type == "store_code").attributes[] | select(.key == "code_id").value')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now since we use the flag sync, we can't just read directly from res but rather query the tx and parse from there.

@@ -48,7 +49,7 @@ function store_artifact_on_chain() {

# Write code_id in output file
tmpfile=$(mktemp)
jq --arg artifact $(basename "$artifact") --arg code_id $code_id --arg version $version '.contracts += [{wasm: $artifact, code_id: $code_id, version: $version}]' $output_file >$tmpfile
jq --arg artifact "$(basename "$artifact")" --arg code_id "$code_id" --arg version "$version" '.contracts += [{"wasm": $artifact, "code_id": $code_id, "version": $version}]' "$output_file" >"$tmpfile"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unix quotes yada yada

@@ -3,7 +3,7 @@ set -e

deployment_script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
project_root_path=$(realpath "$0" | sed 's|\(.*\)/.*|\1|' | cd ../ | pwd)
tx_delay=8
tx_delay=14
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 seconds was too aggresive, was getting sequence missmatch sometimes

@kerber0x kerber0x force-pushed the ci/scripts-improvement branch from 23847d3 to da55e32 Compare February 7, 2024 17:27
@kerber0x kerber0x changed the title ci: adds just recipes for deploying and store contracts ci: add just recipes for deploying and store contracts Feb 8, 2024
@kerber0x kerber0x merged commit a469af5 into main Feb 8, 2024
4 checks passed
@kerber0x kerber0x deleted the ci/scripts-improvement branch February 8, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant