scripts: uppercase digest in governance generator

the injection command prints out in this format, so it's easier to read
for guardians this way
This commit is contained in:
Csongor Kiss 2022-10-18 00:32:52 +01:00 committed by Evan Gray
parent 4e3b24cfa8
commit 500654cf02
2 changed files with 14 additions and 4 deletions

View File

@ -323,6 +323,11 @@ echo "$rest" >> "$gov_msg_file"
verify=$(guardiand admin governance-vaa-verify "$gov_msg_file" 2>&1)
digest=$(echo "$verify" | grep "VAA with digest" | cut -d' ' -f6 | sed 's/://g')
# massage the digest into the same format that the inject command prints it
digest=$(echo "$digest" | awk '{print toupper($0)}' | sed 's/^0X//')
# we use the first 7 characters of the digest as an identifier for the prototxt file
gov_id=$(echo "$digest" | cut -c1-7)
################################################################################
# Print vote command and expected digests
@ -333,12 +338,12 @@ cat <<-EOD
Shell command for voting:
\`\`\`shell
cat << EOF > governance.prototxt
cat << EOF > governance-$gov_id.prototxt
$(cat "$gov_msg_file")
EOF
guardiand admin governance-vaa-inject --socket /path/to/admin.sock governance.prototxt
guardiand admin governance-vaa-inject --socket /path/to/admin.sock governance-$gov_id.prototxt
\`\`\`
Expected digest(s):

View File

@ -153,6 +153,11 @@ echo "$rest" >> "$gov_msg_file"
verify=$(guardiand admin governance-vaa-verify "$gov_msg_file" 2>&1)
digest=$(echo "$verify" | grep "VAA with digest" | cut -d' ' -f6 | sed 's/://g')
# massage the digest into the same format that the inject command prints it
digest=$(echo "$digest" | awk '{print toupper($0)}' | sed 's/^0X//')
# we use the first 7 characters of the digest as an identifier for the prototxt file
gov_id=$(echo "$digest" | cut -c1-7)
################################################################################
# Print vote command and expected digests
@ -163,12 +168,12 @@ cat <<-EOD
Shell command for voting:
\`\`\`shell
cat << EOF > governance.prototxt
cat << EOF > governance-$gov_id.prototxt
$(cat "$gov_msg_file")
EOF
guardiand admin governance-vaa-inject --socket /path/to/admin.sock governance.prototxt
guardiand admin governance-vaa-inject --socket /path/to/admin.sock governance-$gov_id.prototxt
\`\`\`
Expected digest(s):