Skip to content

Commit

Permalink
use confirmed level for fetching proposal account
Browse files Browse the repository at this point in the history
  • Loading branch information
aalu1418 committed Feb 15, 2024
1 parent aea600f commit 9dd8667
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions integration-tests/solclient/ocr2.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/binary"
"fmt"

bin "github.com/gagliardetto/binary"
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -194,6 +195,18 @@ func (m *OCRv2) fetchProposalAccount() (*ocr_2.Proposal, error) {
m.Proposal.PublicKey(),
&proposal,
)
// reimplement GetAccountDataInto with options
resp, err := m.Client.RPC.GetAccountInfoWithOpts(
context.Background(),
m.Proposal.PublicKey(),
&rpc.GetAccountInfoOpts{
Commitment: rpc.CommitmentConfirmed,
},
)
if err != nil {
return err
}
err = bin.NewBinDecoder(resp.Value.Data.GetBinary()).Decode(&proposal)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 9dd8667

Please sign in to comment.