Fix request and comments

This commit is contained in:
Slavomir 2021-07-11 17:58:41 +02:00
parent b5290cbfb8
commit b3a107beda
5 changed files with 19 additions and 14 deletions

View File

@ -7,19 +7,6 @@ import (
"github.com/gagliardetto/solana-go" "github.com/gagliardetto/solana-go"
) )
// GetBlock returns identity and transaction information about a confirmed block in the ledger.
// NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlock for solana-core v1.6
func (cl *Client) GetBlock(
ctx context.Context,
slot uint64,
) (out *GetBlockResult, err error) {
return cl.GetBlockWithOpts(
ctx,
slot,
nil,
)
}
type TransactionDetailsType string type TransactionDetailsType string
const ( const (
@ -35,6 +22,21 @@ type GetBlockOpts struct {
Commitment CommitmentType // "processed" is not supported. If parameter not provided, the default is "finalized". Commitment CommitmentType // "processed" is not supported. If parameter not provided, the default is "finalized".
} }
// GetBlock returns identity and transaction information about a confirmed block in the ledger.
// NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlock for solana-core v1.6
func (cl *Client) GetBlock(
ctx context.Context,
slot uint64,
) (out *GetBlockResult, err error) {
return cl.GetBlockWithOpts(
ctx,
slot,
nil,
)
}
// GetBlock returns identity and transaction information about a confirmed block in the ledger.
// NEW: This method is only available in solana-core v1.7 or newer. Please use getConfirmedBlock for solana-core v1.6
func (cl *Client) GetBlockWithOpts( func (cl *Client) GetBlockWithOpts(
ctx context.Context, ctx context.Context,
slot uint64, slot uint64,

View File

@ -9,6 +9,7 @@ import (
type BlocksResult []bin.Uint64 type BlocksResult []bin.Uint64
// GetBlocks returns a list of confirmed blocks between two slots. // GetBlocks returns a list of confirmed blocks between two slots.
//
// NEW: This method is only available in solana-core v1.7 or newer. // NEW: This method is only available in solana-core v1.7 or newer.
// Please use getConfirmedBlocks for solana-core v1.6. // Please use getConfirmedBlocks for solana-core v1.6.
// The result will be an array of u64 integers listing confirmed blocks // The result will be an array of u64 integers listing confirmed blocks

View File

@ -22,7 +22,7 @@ import (
func (cl *Client) GetRecentBlockhash(ctx context.Context, commitment CommitmentType) (out *GetRecentBlockhashResult, err error) { func (cl *Client) GetRecentBlockhash(ctx context.Context, commitment CommitmentType) (out *GetRecentBlockhashResult, err error) {
params := []interface{}{} params := []interface{}{}
if commitment != "" { if commitment != "" {
params = append(params, M{"commitment": string(commitment)}) params = append(params, M{"commitment": commitment})
} }
err = cl.rpcClient.CallFor(&out, "getRecentBlockhash", params) err = cl.rpcClient.CallFor(&out, "getRecentBlockhash", params)

View File

@ -16,6 +16,7 @@ type GetSignaturesForAddressOpts struct {
// GetSignaturesForAddress returns confirmed signatures for transactions // GetSignaturesForAddress returns confirmed signatures for transactions
// involving an address backwards in time from the provided signature // involving an address backwards in time from the provided signature
// or most recent confirmed block. // or most recent confirmed block.
//
// NEW: This method is only available in solana-core v1.7 or newer. // NEW: This method is only available in solana-core v1.7 or newer.
// Please use getConfirmedSignaturesForAddress2 for solana-core v1.6 // Please use getConfirmedSignaturesForAddress2 for solana-core v1.6
func (cl *Client) GetSignaturesForAddress( func (cl *Client) GetSignaturesForAddress(

View File

@ -21,6 +21,7 @@ type GetTransactionOpts struct {
} }
// GetTransaction returns transaction details for a confirmed transaction. // GetTransaction returns transaction details for a confirmed transaction.
//
// NEW: This method is only available in solana-core v1.7 or newer. // NEW: This method is only available in solana-core v1.7 or newer.
// Please use getConfirmedTransaction for solana-core v1.6 // Please use getConfirmedTransaction for solana-core v1.6
func (cl *Client) GetTransaction( func (cl *Client) GetTransaction(