-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: sanitize head ref and unbond second validator power
- Loading branch information
1 parent
162be80
commit 52f5915
Showing
5 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
func queryOperatorAddress(cmdPath, homePath, keyringBackend, validatorName string) string { | ||
// Command and arguments | ||
args := []string{"keys", "show", validatorName, "--bech", "val", "--home", homePath, "--keyring-backend", keyringBackend, "--address"} | ||
|
||
// Execute the command | ||
output, err := exec.Command(cmdPath, args...).CombinedOutput() | ||
if err != nil { | ||
log.Fatalf(ColorRed+"Failed to query validator pubkey: %v", err) | ||
} | ||
|
||
// trim the output | ||
outputStr := strings.TrimSpace(string(output)) | ||
|
||
return outputStr | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os/exec" | ||
"time" | ||
) | ||
|
||
func unbondValidator(cmdPath, validatorKeyName, operatorAddress, validatorSelfDelegation, keyringBackend, chainId, rpc, broadcastMode, homePath string) { | ||
// Command and arguments | ||
args := []string{ | ||
"tx", | ||
"staking", | ||
"unbond", | ||
operatorAddress, | ||
validatorSelfDelegation, | ||
"--from", validatorKeyName, | ||
"--keyring-backend", keyringBackend, | ||
"--chain-id", chainId, | ||
"--node", rpc, | ||
"--broadcast-mode", broadcastMode, | ||
"--fees", "100000uelys", | ||
"--gas", "1000000", | ||
"--home", homePath, | ||
"--output", "json", | ||
"--yes", | ||
} | ||
|
||
// Execute the command | ||
output, err := exec.Command(cmdPath, args...).CombinedOutput() | ||
if err != nil { | ||
log.Fatalf(ColorRed+"Command execution failed: %v", err) | ||
} | ||
|
||
// Parse output to find the transaction hash | ||
txHash, err := parseTxHash(output) | ||
if err != nil { | ||
log.Fatalf(ColorRed+"Failed to parse transaction hash: %v", err) | ||
} | ||
|
||
waitForTxConfirmation(cmdPath, rpc, txHash, 5*time.Minute) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters