forked from cerc-io/laconicd-deprecated
eth_newBlockFilter and related functionality (#232)
* add filter types for block, pending tx, log * implement pollForBlocks for block filters * implement getFilterChanges for block filter * implement uninstall filter by stopping polling
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
|
||||
"github.com/cosmos/ethermint/x/evm/types"
|
||||
@@ -22,7 +23,7 @@ func GetQueryCmd(moduleName string, cdc *codec.Codec) *cobra.Command {
|
||||
SuggestionsMinimumDistance: 2,
|
||||
RunE: client.ValidateCmd,
|
||||
}
|
||||
evmQueryCmd.AddCommand(client.GetCommands(
|
||||
evmQueryCmd.AddCommand(flags.GetCommands(
|
||||
GetCmdGetStorageAt(moduleName, cdc),
|
||||
GetCmdGetCode(moduleName, cdc),
|
||||
)...)
|
||||
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/context"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
@@ -33,7 +34,7 @@ func GetTxCmd(storeKey string, cdc *codec.Codec) *cobra.Command {
|
||||
RunE: client.ValidateCmd,
|
||||
}
|
||||
|
||||
evmTxCmd.AddCommand(client.PostCommands(
|
||||
evmTxCmd.AddCommand(flags.PostCommands(
|
||||
GetCmdGenTx(cdc),
|
||||
GetCmdGenCreateTx(cdc),
|
||||
)...)
|
||||
@@ -73,7 +74,7 @@ func GetCmdGenTx(cdc *codec.Codec) *cobra.Command {
|
||||
|
||||
data, err = hexutil.Decode(payload)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +118,7 @@ func GetCmdGenCreateTx(cdc *codec.Codec) *cobra.Command {
|
||||
|
||||
data, err := hexutil.Decode(payload)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return err
|
||||
}
|
||||
|
||||
var amount int64
|
||||
|
||||
@@ -97,10 +97,6 @@ func (k *Keeper) GetBlockBloomMapping(ctx sdk.Context, height int64) (ethtypes.B
|
||||
}
|
||||
|
||||
bloom := store.Get(types.BloomKey(bz))
|
||||
if len(bloom) == 0 {
|
||||
return ethtypes.BytesToBloom([]byte{}), fmt.Errorf("block with bloombits %v not found", bloom)
|
||||
}
|
||||
|
||||
return ethtypes.BytesToBloom(bloom), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user