Skip to content

Commit

Permalink
Add support to v0.119.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Oct 27, 2024
1 parent a0b6e82 commit c84a8b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ type Client interface {
// SendTransaction send new transaction into transaction pool.
SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, error)

// SendTestTransaction send new transaction into transaction pool.
SendTestTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, error)

/// Test if a transaction can be accepted by the transaction pool without inserting it into the pool or rebroadcasting it to peers.
/// The parameters and errors of this method are the same as `send_transaction`.
TestTxPoolAccept(ctx context.Context, tx *types.Transaction) (*types.EntryCompleted, error)
Expand Down Expand Up @@ -685,6 +688,17 @@ func (cli *client) SendTransaction(ctx context.Context, tx *types.Transaction) (
return &result, err
}

func (cli *client) SendTestTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, error) {
var result types.Hash

err := cli.c.CallContext(ctx, &result, "send_test_transaction", *tx, "passthrough")
if err != nil {
return nil, err
}

return &result, err
}

// TestTxPoolAccept(ctx context.Context, tx *types.Transaction) (*types.EntryCompleted, error)
func (cli *client) TestTxPoolAccept(ctx context.Context, tx *types.Transaction) (*types.EntryCompleted, error) {
var result types.EntryCompleted
Expand Down
8 changes: 5 additions & 3 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@ type CellWithStatus struct {
}

type TxStatus struct {
Status TransactionStatus `json:"status"`
BlockHash *Hash `json:"block_hash"`
Reason *string `json:"reason"`
Status TransactionStatus `json:"status"`
BlockHash *Hash `json:"block_hash"`
BlockNumber *uint64 `json:"block_number"`
TxIndex *uint `json:"tx_index"`
Reason *string `json:"reason"`
}

type TransactionWithStatus struct {
Expand Down

0 comments on commit c84a8b8

Please sign in to comment.