fix
This commit is contained in:
@@ -11,8 +11,8 @@ if is_decimal "$block_input"; then
|
|||||||
block_input="0x$(printf "%x" "$block_input")"
|
block_input="0x$(printf "%x" "$block_input")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
request="{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${block_input}\",false],\"id\":1}"
|
request="{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"${block_input}\", false],\"id\":1}"
|
||||||
|
|
||||||
echo "${request}"
|
echo "${request}"
|
||||||
|
|
||||||
curl -s -X POST "${1}" -H "Content-Type: application/json" --data "'${request}'" | jq -r '.result.number, .result.hash' | gawk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'
|
curl -s -X POST "${1}" -H "Content-Type: application/json" --data "${request}" | jq -r '.result.number, .result.hash' | gawk '{if (NR==1) print "Block Number:", strtonum($0); else print "Block Hash:", $0}'
|
||||||
|
|||||||
Reference in New Issue
Block a user