diff --git a/Makefile b/Makefile index f44c3adf3..c3767ce71 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -PACKAGES=$(shell go list ./... | grep -v '/vendor/') +PACKAGES=$(shell go list ./... | grep -Ev 'vendor|importer') COMMIT_HASH := $(shell git rev-parse --short HEAD) BUILD_FLAGS = -tags netgo -ldflags "-X github.com/cosmos/ethermint/version.GitCommit=${COMMIT_HASH}" DOCKER_TAG = unstable diff --git a/handlers/ante.go b/handlers/ante.go index c63f33d52..a13ac1cad 100644 --- a/handlers/ante.go +++ b/handlers/ante.go @@ -105,11 +105,6 @@ func handleEthTx(sdkCtx sdk.Context, tx sdk.Tx, accMapper auth.AccountMapper) (s // TODO: Investigate gas consumption models as the EVM instruction set has its // own and we should probably not charge for additional gas where we don't have // to. - // - // err = acc.SetSequence(seq + 1) - // if err != nil { - // return sdkCtx, sdk.ErrInternal(err.Error()).Result(), true - // } accMapper.SetAccount(sdkCtx, acc) return sdkCtx, sdk.Result{GasWanted: int64(ethTx.Data().GasLimit)}, false @@ -135,7 +130,6 @@ func handleEmbeddedTx(sdkCtx sdk.Context, tx sdk.Tx, accMapper auth.AccountMappe signer := ethcmn.BytesToAddress(signerAddrs[i].Bytes()) acc, err := validateSignature(sdkCtx, stdTx, signer, sig, accMapper) - // err.Code() != sdk.CodeOK if err != nil { return sdkCtx, err.Result(), true } diff --git a/handlers/ante_test.go b/handlers/ante_test.go index cff445153..61bc87437 100644 --- a/handlers/ante_test.go +++ b/handlers/ante_test.go @@ -16,6 +16,8 @@ import ( "github.com/tendermint/tendermint/libs/log" ) +// TODO: These tests will radically change as the ante handler develops + func TestEthTxBadSig(t *testing.T) { tx := types.NewTransaction(uint64(0), types.TestAddr1, big.NewInt(10), 1000, big.NewInt(100), []byte{}) @@ -68,29 +70,6 @@ func TestEthTxIncorrectNonce(t *testing.T) { require.Equal(t, sdk.ABCICodeType(0x10003), res.Code, fmt.Sprintf("invalid code returned on bad tx: %s", res.Log)) } -func TestEthTxValidTx(t *testing.T) { - tx := types.NewTransaction(0, types.TestAddr1, big.NewInt(50), 1000, big.NewInt(1000), []byte{}) - tx.Sign(types.TestChainID, types.TestPrivKey1) - - ms, key := createTestMultiStore() - ctx := sdk.NewContext(ms, abci.Header{ChainID: types.TestChainID.String()}, false, nil) - accMapper := auth.NewAccountMapper(types.NewTestCodec(), key, auth.ProtoBaseAccount) - - // set account in accountMapper - acc := accMapper.NewAccountWithAddress(ctx, types.TestAddr1.Bytes()) - accMapper.SetAccount(ctx, acc) - - handler := AnteHandler(accMapper, auth.FeeCollectionKeeper{}) - _, res, abort := handler(ctx, *tx) - - require.False(t, abort, "expected ante handler to not abort") - require.True(t, res.IsOK(), fmt.Sprintf("result not OK on valid Tx: %s", res.Log)) - - // ensure account state updated correctly - seq, _ := accMapper.GetSequence(ctx, types.TestAddr1[:]) - require.Equal(t, int64(1), seq, "account nonce did not increment correctly") -} - func TestEmbeddedTxBadSig(t *testing.T) { testCodec := types.NewTestCodec() testFee := types.NewTestStdFee() diff --git a/importer/importer_test.go b/importer/importer_test.go index 8852592f7..5fd30a3e9 100644 --- a/importer/importer_test.go +++ b/importer/importer_test.go @@ -67,6 +67,7 @@ func newTestCodec() *wire.Codec { codec := wire.NewCodec() types.RegisterWire(codec) + auth.RegisterWire(codec) wire.RegisterCrypto(codec) return codec diff --git a/types/wire.go b/types/wire.go index 25212484d..ad1f2e303 100644 --- a/types/wire.go +++ b/types/wire.go @@ -3,7 +3,6 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/wire" - "github.com/cosmos/cosmos-sdk/x/auth" ) var typesCodec = wire.NewCodec() @@ -16,7 +15,6 @@ func init() { // codec. func RegisterWire(codec *wire.Codec) { sdk.RegisterWire(codec) - codec.RegisterInterface((*auth.Account)(nil), nil) codec.RegisterConcrete(&Transaction{}, "types/Transaction", nil) codec.RegisterConcrete(&Account{}, "types/Account", nil) }