Skip to content

Commit

Permalink
fix: jq fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega committed Oct 11, 2023
1 parent 40ce5c1 commit 901bcd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/testnet/add_wasm_state_to_genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ TMP_TMP_GENESIS=$TMP_HOME/tmp_tmp_genesis.json
# - wasm.sequences
# - wasm-storage.proxy_contract_registry
#
CODES=$(jq '.app_state["wasm"]["codes"]' $EXPORTED_GENESIS)
CONTRACTS=$(jq '.app_state["wasm"]["contracts"]' $EXPORTED_GENESIS)
SEQUENCES=$(jq '.app_state["wasm"]["sequences"]' $EXPORTED_GENESIS)

jq '.app_state["wasm-storage"]["proxy_contract_registry"]="'$PROXY_ADDR'"' "$ORIGINAL_GENESIS" > "$TMP_TMP_GENESIS" && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq '.app_state["wasm"]["codes"]='"$CODES"'' "$TMP_GENESIS" > "$TMP_TMP_GENESIS" && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq '.app_state["wasm"]["contracts"]='"$CONTRACTS"'' "$TMP_GENESIS" > "$TMP_TMP_GENESIS" && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq '.app_state["wasm"]["sequences"]='"$SEQUENCES"'' "$TMP_GENESIS" > "$TMP_TMP_GENESIS" && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq '.app_state["wasm"]["codes"]' $EXPORTED_GENESIS > $TMP_HOME/codes.tmp
jq '.app_state["wasm"]["contracts"]' $EXPORTED_GENESIS > $TMP_HOME/contracts.tmp
jq '.app_state["wasm"]["sequences"]' $EXPORTED_GENESIS > $TMP_HOME/sequences.tmp

jq '.app_state["wasm-storage"]["proxy_contract_registry"]="'$PROXY_ADDR'"' $ORIGINAL_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq --argfile codes $TMP_HOME/codes.tmp '.app_state["wasm"]["codes"] = $codes' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq --argfile contracts $TMP_HOME/contracts.tmp '.app_state["wasm"]["contracts"] = $contracts' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS
jq --argfile sequences $TMP_HOME/sequences.tmp '.app_state["wasm"]["sequences"] = $sequences' $TMP_GENESIS > $TMP_TMP_GENESIS && mv $TMP_TMP_GENESIS $TMP_GENESIS

mv $TMP_GENESIS $ORIGINAL_GENESIS
rm -rf $TMP_HOME

0 comments on commit 901bcd6

Please sign in to comment.