@@ -152,6 +152,10 @@ type Client interface {
152
152
// SendTransaction send new transaction into transaction pool.
153
153
SendTransaction (ctx context.Context , tx * types.Transaction ) (* types.Hash , error )
154
154
155
+ /// Test if a transaction can be accepted by the transaction pool without inserting it into the pool or rebroadcasting it to peers.
156
+ /// The parameters and errors of this method are the same as `send_transaction`.
157
+ TestTxPoolAccept (ctx context.Context , tx * types.Transaction ) (* types.EntryCompleted , error )
158
+
155
159
// TxPoolInfo return the transaction pool information
156
160
TxPoolInfo (ctx context.Context ) (* types.TxPoolInfo , error )
157
161
@@ -671,6 +675,17 @@ func (cli *client) SendTransaction(ctx context.Context, tx *types.Transaction) (
671
675
return & result , err
672
676
}
673
677
678
+ // TestTxPoolAccept(ctx context.Context, tx *types.Transaction) (*types.EntryCompleted, error)
679
+ func (cli * client ) TestTxPoolAccept (ctx context.Context , tx * types.Transaction ) (* types.EntryCompleted , error ) {
680
+ var result types.EntryCompleted
681
+
682
+ err := cli .c .CallContext (ctx , & result , "test_tx_pool_accept" , * tx , "passthrough" )
683
+ if err != nil {
684
+ return nil , err
685
+ }
686
+ return & result , nil
687
+ }
688
+
674
689
func (cli * client ) GetPoolTxDetailInfo (ctx context.Context , hash types.Hash ) (* types.PoolTxDetailInfo , error ) {
675
690
var result types.PoolTxDetailInfo
676
691
err := cli .c .CallContext (ctx , & result , "get_pool_tx_detail" , hash )
0 commit comments