Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Nov 30, 2023
1 parent 585fff5 commit 29d191f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions node/hack/solana/account_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion node/pkg/watchers/solana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 29d191f

Please sign in to comment.