Skip to content

Commit

Permalink
Support include_tx_pool param for GetLiveCell
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Aug 8, 2024
1 parent f579c14 commit 9eb6cda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type Client interface {
GetPackedHeaderByNumber(ctx context.Context, number uint64) (*types.Header, error)
// GetLiveCell returns the information about a cell by out_point if it is live.
// If second with_data argument set to true, will return cell data and data_hash if it is live.
GetLiveCell(ctx context.Context, outPoint *types.OutPoint, withData bool) (*types.CellWithStatus, error)
GetLiveCell(ctx context.Context, outPoint *types.OutPoint, withData bool, include_tx_pool *bool) (*types.CellWithStatus, error)

// GetTransaction returns the information about a transaction requested by transaction hash.
GetTransaction(ctx context.Context, hash types.Hash, only_committed *bool) (*types.TransactionWithStatus, error)
Expand Down Expand Up @@ -446,7 +446,7 @@ func (cli *client) VerifyTransactionAndWitnessProof(ctx context.Context, proof *
return result, err
}

func (cli *client) GetLiveCell(ctx context.Context, point *types.OutPoint, withData bool) (*types.CellWithStatus, error) {
func (cli *client) GetLiveCell(ctx context.Context, point *types.OutPoint, withData bool, include_tx_pool *bool) (*types.CellWithStatus, error) {
var result types.CellWithStatus
err := cli.c.CallContext(ctx, &result, "get_live_cell", *point, withData)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion rpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func TestClient_GetLiveCell(t *testing.T) {
TxHash: types.HexToHash("0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37"),
Index: 0,
}
cellWithStatus, err := testClient.GetLiveCell(ctx, &outPoint, true)
cellWithStatus, err := testClient.GetLiveCell(ctx, &outPoint, true, nil)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 9eb6cda

Please sign in to comment.