Skip to content

Commit

Permalink
Merge pull request #22 from mirrorworld-universe/aide
Browse files Browse the repository at this point in the history
feat: Enable retrieval of the last block in SolanaClient
  • Loading branch information
yusufyian authored Jul 7, 2024
2 parents 1a26714 + e9bb885 commit 580ea85
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hypergrid-aide/tools/solana.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ func (s *SolanaClient) GetFirstBlock() (uint64, error) {
return 0, nil
}

func (s *SolanaClient) GetLastBlock() (uint64, error) {
// resp, err := s.Client.GetBlock() .GetBlocksWithLimit(context.TODO(), 0, 1, rpc.CommitmentFinalized)
// if err != nil {
// return 0, err
// }
// if len(*resp) > 0 {
// return (*resp)[0], nil
// }
return 0, nil
}

func (s *SolanaClient) GetBlocks(start_slot uint64, limit uint64) ([]SolanaBlock, error) {
println("GetBlocks start_slot: ", start_slot)
resp, err := s.Client.GetBlocksWithLimit(context.TODO(), start_slot, limit, rpc.CommitmentFinalized)
Expand Down

0 comments on commit 580ea85

Please sign in to comment.