From 5a03bff521c311b579093ce2de3d9ddf163034bf Mon Sep 17 00:00:00 2001 From: Bruce Riley Date: Thu, 30 Nov 2023 15:21:03 -0600 Subject: [PATCH] Fix formatting --- node/hack/solana/account_lookup.go | 12 +++++++----- node/pkg/watchers/solana/client.go | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/node/hack/solana/account_lookup.go b/node/hack/solana/account_lookup.go index ce10ee92fc..d4a3f8e810 100644 --- a/node/hack/solana/account_lookup.go +++ b/node/hack/solana/account_lookup.go @@ -10,6 +10,8 @@ import ( "github.com/gagliardetto/solana-go/rpc" ) +const RPC = "https://api.devnet.solana.com" + func populateLookupTableAccounts(ctx context.Context, tx *solana.Transaction, rpcClient *rpc.Client) error { if !tx.Message.IsVersioned() { return nil @@ -53,24 +55,24 @@ func populateLookupTableAccounts(ctx context.Context, tx *solana.Transaction, rp func main() { ctx := context.Background() testTx, err := solana.SignatureFromBase58("2Jr3bAuEKwYBKmaqSmmFQ2R7xxxQpmjY8g3N3gMH49C62kBaweUgc9UCEcFhqcewAVnDLcBGWUSQrKZ7vdxpBbq4") - if (err != nil) { + if err != nil { log.Fatal("SignatureFromBase58 errored", err) } - rpcClient := rpc.New("https://api.devnet.solana.com") + rpcClient := rpc.New(RPC) maxSupportedTransactionVersion := uint64(0) tx, err := rpcClient.GetTransaction(ctx, testTx, &rpc.GetTransactionOpts{ Encoding: solana.EncodingBase64, MaxSupportedTransactionVersion: &maxSupportedTransactionVersion, }) - if (err != nil) { + if err != nil { log.Fatal("getTransaction errored", err) } realTx, err := tx.Transaction.GetTransaction() - if (err != nil) { + if err != nil { log.Fatal("GetTransaction errored", err) } err = populateLookupTableAccounts(ctx, realTx, rpcClient) - if (err != nil) { + if err != nil { log.Fatal("populateLookupTableAccounts errored", err) } diff --git a/node/pkg/watchers/solana/client.go b/node/pkg/watchers/solana/client.go index 3b80277b5a..7cdcfaa274 100644 --- a/node/pkg/watchers/solana/client.go +++ b/node/pkg/watchers/solana/client.go @@ -821,7 +821,7 @@ func (s *SolanaWatcher) processMessageAccount(logger *zap.Logger, data []byte, a zap.Error(err)) return } - if commitment != s.commitment { + if commitment != s.commitment { logger.Debug("skipping message which does not match the watcher commitment", zap.Stringer("account", acc), zap.String("message commitment", string(commitment)), zap.String("watcher commitment", string(s.commitment))) return }