Skip to content

Commit

Permalink
CI scripts linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-sekara committed Oct 22, 2024
1 parent 62939c3 commit 8e74b6a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions core/scripts/ccip/ccip-revert-reason/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var (
errorCodeString = flag.String("errorCode", "", "Error code string (e.g. 0x08c379a0)")

chainId = flag.Uint64("chainId", 0, "Chain ID for the transaction (e.g. 420)")
chainID = flag.Uint64("chainId", 0, "Chain ID for the transaction (e.g. 420)")
txHash = flag.String("txHash", "", "Transaction hash (e.g. 0x97be8559164442595aba46b5f849c23257905b78e72ee43d9b998b28eee78b84)")
txRequester = flag.String("txRequester", "", "Transaction requester address (e.g. 0xe88ff73814fb891bb0e149f5578796fa41f20242)")
rpcURL = flag.String("rpcURL", "", "RPC URL for the chain (can also be set in env var RPC_<chain_id>)")
Expand All @@ -28,7 +28,7 @@ func main() {

flag.Parse()

if *errorCodeString == "" && (*chainId == 0 || *txHash == "" || *txRequester == "") {
if *errorCodeString == "" && (*chainID == 0 || *txHash == "" || *txRequester == "") {
flag.Usage()
return
}
Expand All @@ -53,8 +53,8 @@ func getErrorString() (string, error) {
}

if *rpcURL == "" {
fmt.Printf("RPC URL not provided, looking for RPC_%d env var\n", *chainId)
envRPC := secrets.GetRPC(*chainId)
fmt.Printf("RPC URL not provided, looking for RPC_%d env var\n", *chainID)
envRPC := secrets.GetRPC(*chainID)
rpcURL = &envRPC
}

Expand Down
2 changes: 1 addition & 1 deletion core/scripts/ccip/debugreceiver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

type ccipAny struct {
SourceChainId *big.Int
SourceChainID *big.Int
Sender []byte
Data []byte
Tokens []common.Address
Expand Down
18 changes: 9 additions & 9 deletions core/scripts/ccip/liquiditymanager/multienv/multienv.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
// Environment variables used to configure
// the environment for the rebalancer
const (
// OWNER_KEY is the private key used to deploy contracts and send funds to the rebalancer nodes
OWNER_KEY = "OWNER_KEY"
// RPC_ is the prefix for the environment variable that contains the RPC URL for a chain
RPC_ = "RPC_"
// WS_ is the prefix for the environment variable that contains the WebSocket URL for a chain
WS_ = "WS_"
// OwnerKey is the private key used to deploy contracts and send funds to the rebalancer nodes
OwnerKey = "OWNER_KEY"
// RpcPrefix is the prefix for the environment variable that contains the RPC URL for a chain
RpcPrefix = "RPC_"

Check failure on line 25 in core/scripts/ccip/liquiditymanager/multienv/multienv.go

View workflow job for this annotation

GitHub Actions / lint-scripts

var-naming: const RpcPrefix should be RPCPrefix (revive)
// WebSocketPerfix is the prefix for the environment variable that contains the WebSocket URL for a chain
WebSocketPerfix = "WS_"
)

type Env struct {
Expand Down Expand Up @@ -65,7 +65,7 @@ func New(websocket bool, overrideNonce bool) Env {
}

func GetRPC(chainID uint64) (string, error) {
envVariable := RPC_ + strconv.FormatUint(chainID, 10)
envVariable := RpcPrefix + strconv.FormatUint(chainID, 10)
rpc := os.Getenv(envVariable)
if rpc != "" {
return rpc, nil
Expand All @@ -74,7 +74,7 @@ func GetRPC(chainID uint64) (string, error) {
}

func GetWS(chainID uint64) (string, error) {
envVariable := WS_ + strconv.FormatUint(chainID, 10)
envVariable := WebSocketPerfix + strconv.FormatUint(chainID, 10)
ws := os.Getenv(envVariable)
if ws != "" {
return ws, nil
Expand All @@ -83,7 +83,7 @@ func GetWS(chainID uint64) (string, error) {
}

func GetTransactor(chainID *big.Int) *bind.TransactOpts {
ownerKey := os.Getenv(OWNER_KEY)
ownerKey := os.Getenv(OwnerKey)
if ownerKey != "" {
b, err := hex.DecodeString(ownerKey)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions core/scripts/ccip/revert-reason/handler/reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ func (h *BaseHandler) RevertReasonFromErrorCodeString(errorCodeString string) (s
func (h *BaseHandler) RevertReasonFromTx(txHash string) (string, error) {
// Need a node URL
// NOTE: this node needs to run in archive mode
ethUrl := h.cfg.NodeURL
if ethUrl == "" {
ethURL := h.cfg.NodeURL
if ethURL == "" {
panicErr(errors.New("you must define ETH_NODE env variable"))
}
requester := h.cfg.FromAddress

ec, err := ethclient.Dial(ethUrl)
ec, err := ethclient.Dial(ethURL)
panicErr(err)
errorString, _ := GetErrorForTx(ec, txHash, requester)

Expand Down

0 comments on commit 8e74b6a

Please sign in to comment.