mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 22:44:24 +00:00
config: cswal_light, mempool_broadcast, mempool_reap
This commit is contained in:
@@ -39,3 +39,8 @@ func UnconfirmedTxs() (*ctypes.ResultUnconfirmedTxs, error) {
|
||||
txs := mempoolReactor.Mempool.Reap()
|
||||
return &ctypes.ResultUnconfirmedTxs{len(txs), txs}, nil
|
||||
}
|
||||
|
||||
func TestStartMempool() (*ctypes.ResultTestStartMempool, error) {
|
||||
config.Set("mempool_reap", true)
|
||||
return &ctypes.ResultTestStartMempool{}, nil
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ var Routes = map[string]*rpc.RPCFunc{
|
||||
"broadcast_tx_sync": rpc.NewRPCFunc(BroadcastTxSyncResult, "tx"),
|
||||
"broadcast_tx_async": rpc.NewRPCFunc(BroadcastTxAsyncResult, "tx"),
|
||||
"unconfirmed_txs": rpc.NewRPCFunc(UnconfirmedTxsResult, ""),
|
||||
"test_start_mempool": rpc.NewRPCFunc(TestStartMempoolResult, ""), // move to test server ?
|
||||
// subscribe/unsubscribe are reserved for websocket events.
|
||||
}
|
||||
|
||||
@@ -126,3 +127,11 @@ func BroadcastTxAsyncResult(tx []byte) (ctypes.TMResult, error) {
|
||||
return r, nil
|
||||
}
|
||||
}
|
||||
|
||||
func TestStartMempoolResult() (ctypes.TMResult, error) {
|
||||
if r, err := TestStartMempool(); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
return r, nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ type ResultUnconfirmedTxs struct {
|
||||
Txs []types.Tx `json:"txs"`
|
||||
}
|
||||
|
||||
type ResultTestStartMempool struct{}
|
||||
|
||||
type ResultSubscribe struct {
|
||||
}
|
||||
|
||||
@@ -105,6 +107,9 @@ const (
|
||||
ResultTypeSubscribe = byte(0x80)
|
||||
ResultTypeUnsubscribe = byte(0x81)
|
||||
ResultTypeEvent = byte(0x82)
|
||||
|
||||
// 0xa bytes for testing
|
||||
ResultTypeTestStartMempool = byte(0xa0)
|
||||
)
|
||||
|
||||
type TMResult interface {
|
||||
@@ -127,4 +132,5 @@ var _ = wire.RegisterInterface(
|
||||
wire.ConcreteType{&ResultSubscribe{}, ResultTypeSubscribe},
|
||||
wire.ConcreteType{&ResultUnsubscribe{}, ResultTypeUnsubscribe},
|
||||
wire.ConcreteType{&ResultEvent{}, ResultTypeEvent},
|
||||
wire.ConcreteType{&ResultTestStartMempool{}, ResultTypeTestStartMempool},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user