From 2bc7a190c532e94535fc872226127dda06e796e2 Mon Sep 17 00:00:00 2001 From: Shawn Lim Date: Tue, 23 Jan 2024 14:50:54 +0800 Subject: [PATCH 1/2] fix deploy script not correctly saving addr --- scripts/deployment/spot_deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/deployment/spot_deploy.sh b/scripts/deployment/spot_deploy.sh index 4e2fb62..e61c0f5 100755 --- a/scripts/deployment/spot_deploy.sh +++ b/scripts/deployment/spot_deploy.sh @@ -24,7 +24,7 @@ seid=~/go/bin/seid code=$(printf $password | $seid tx wasm store $contract -y --from=$keyname --chain-id=sei-chain --gas=10000000 --fees=10000000usei --broadcast-mode=block | grep -A 1 "code_id" | sed -n 's/.*value: "//p' | sed -n 's/"//p') admin_addr=$(printf $password |$seid keys show $keyname | grep -A 1 "address" | sed -n 's/.*address: //p') -addr=$(printf $password |$seid tx wasm instantiate $code "{}" --from $keyname --broadcast-mode=block --label "spot" --admin $admin_addr --chain-id sei-chain --gas=30000000 --fees=300000usei -y | grep -A 1 -m 1 "key: _contract_address" | sed -n 's/.*value: //p' | xargs) +addr=$(printf $password |$seid tx wasm instantiate $code "{}" --from $keyname --broadcast-mode=block --label "spot" --admin $admin_addr --chain-id sei-chain --gas=30000000 --fees=3000000usei -y | grep -A 1 -m 1 "key: _contract_address" | sed -n 's/.*value: //p') if [[ "$OSTYPE" == "linux-gnu"* ]]; then From 75301ad475b90343cf722b76ecef0fb7285e3d01 Mon Sep 17 00:00:00 2001 From: shawn <46809501+shawnlimjunhe@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:27:44 +0800 Subject: [PATCH 2/2] Change trim command for mac only --- scripts/deployment/spot_deploy.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/deployment/spot_deploy.sh b/scripts/deployment/spot_deploy.sh index e61c0f5..7c818ad 100755 --- a/scripts/deployment/spot_deploy.sh +++ b/scripts/deployment/spot_deploy.sh @@ -1,5 +1,13 @@ #!/bin/bash +trim_whitespace() { + if [[ "$OSTYPE" == "darwin"* ]]; then + sed 's/^[ \t]*//;s/[ \t]*$//' + else + xargs + fi +} + echo -n Customized clearing_house Contract \(../../artifacts/spot_lite.wasm by default\): read contract echo @@ -24,7 +32,7 @@ seid=~/go/bin/seid code=$(printf $password | $seid tx wasm store $contract -y --from=$keyname --chain-id=sei-chain --gas=10000000 --fees=10000000usei --broadcast-mode=block | grep -A 1 "code_id" | sed -n 's/.*value: "//p' | sed -n 's/"//p') admin_addr=$(printf $password |$seid keys show $keyname | grep -A 1 "address" | sed -n 's/.*address: //p') -addr=$(printf $password |$seid tx wasm instantiate $code "{}" --from $keyname --broadcast-mode=block --label "spot" --admin $admin_addr --chain-id sei-chain --gas=30000000 --fees=3000000usei -y | grep -A 1 -m 1 "key: _contract_address" | sed -n 's/.*value: //p') +addr=$(printf $password |$seid tx wasm instantiate $code "{}" --from $keyname --broadcast-mode=block --label "spot" --admin $admin_addr --chain-id sei-chain --gas=30000000 --fees=3000000usei -y | grep -A 1 -m 1 "key: _contract_address" | sed -n 's/.*value: //p' | trim_whitespace) if [[ "$OSTYPE" == "linux-gnu"* ]]; then