mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-29 16:13:47 +00:00
check for empty response in deploy create2 script
This commit is contained in:
parent
c25caee4f3
commit
04f3f15fbd
1 changed files with 4 additions and 0 deletions
|
|
@ -19,6 +19,10 @@ fi
|
|||
DATA='{"jsonrpc":"2.0","method":"eth_getCode","params":["0x4e59b44847b379578588920ca78fbf26c0b4956c", "latest"],"id":1}'
|
||||
RESPONSE=$(curl -s -X POST --data "$DATA" -H "Content-Type: application/json" $JSON_RPC)
|
||||
CODE=$(echo $RESPONSE | jq -r '.result')
|
||||
if [ -z "$RESPONSE" ] || [ "$RESPONSE" == "null" ]; then
|
||||
echo "Error: No response from JSON RPC at $JSON_RPC"
|
||||
exit 1
|
||||
fi
|
||||
if [ "$CODE" != "0x" ]; then
|
||||
echo "Contract already deployed at 0x4e59b44847b379578588920ca78fbf26c0b4956c"
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue