Skip to content

Commit

Permalink
Merge e539790 into b145ed4
Browse files Browse the repository at this point in the history
  • Loading branch information
robdefeo committed Dec 20, 2019
2 parents b145ed4 + e539790 commit 357b5e4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package processor
package actions

import "context"

//go:generate mockgen -source=block.go -package=processortest -destination=./processortest/block_mock.go
//go:generate mockgen -source=block.go -package=actionstest -destination=./actionstest/block_mock.go

// Block processes an individual block
type Block interface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package processor
package actions

import (
"bytes"
Expand All @@ -8,7 +8,7 @@ import (
"github.com/mailchain/mailchain/encoding"
)

//go:generate mockgen -source=transaction.go -package=processortest -destination=./processortest/transaction_mock.go
//go:generate mockgen -source=transaction.go -package=actionstest -destination=./actionstest/transaction_mock.go

// Transaction processes transactions
type Transaction interface {
Expand Down
4 changes: 2 additions & 2 deletions cmd/indexer/internal/ethereum/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"errors"

"github.com/ethereum/go-ethereum/core/types"
"github.com/mailchain/mailchain/cmd/indexer/internal/processor"
"github.com/mailchain/mailchain/cmd/indexer/internal/actions"
)

type Block struct {
txProcessor processor.Transaction
txProcessor actions.Transaction
}

func (b *Block) Run(ctx context.Context, protocol, network string, blk interface{}) error {
Expand Down
6 changes: 3 additions & 3 deletions cmd/indexer/internal/ethereum/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/mailchain/mailchain/cmd/indexer/internal/actions"
"github.com/mailchain/mailchain/cmd/indexer/internal/datastore"
"github.com/mailchain/mailchain/cmd/indexer/internal/processor"
"github.com/mailchain/mailchain/crypto/secp256k1"
"github.com/mailchain/mailchain/internal/protocols/ethereum"
)
Expand All @@ -25,7 +25,7 @@ type txOptions struct {
block *types.Block
}

func (t *Transaction) Run(ctx context.Context, protocol, network string, tx interface{}, txOpts processor.TransactionOptions) error {
func (t *Transaction) Run(ctx context.Context, protocol, network string, tx interface{}, txOpts actions.TransactionOptions) error {
// blk *types.Block, ethTx *types.Transaction
ethTx, ok := tx.(*types.Transaction)
if !ok {
Expand Down Expand Up @@ -64,7 +64,7 @@ func (t *Transaction) Run(ctx context.Context, protocol, network string, tx inte
return err
}

return processor.StoreTransaction(ctx, t.txStore, t.rawTxStore, protocol, network, storeTx, ethTx)
return actions.StoreTransaction(ctx, t.txStore, t.rawTxStore, protocol, network, storeTx, ethTx)
}

func (t *Transaction) toTransaction(blk *types.Block, tx *types.Transaction) (*datastore.Transaction, error) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/indexer/internal/processor/sequential.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package processor
import (
"context"

"github.com/mailchain/mailchain/cmd/indexer/internal/actions"
"github.com/mailchain/mailchain/cmd/indexer/internal/clients"
"github.com/mailchain/mailchain/cmd/indexer/internal/datastore"
)
Expand All @@ -12,7 +13,7 @@ type Sequential struct {
network string

syncStore datastore.SyncStore
blockProcessor Block
blockProcessor actions.Block
blockClient clients.BlockByNumber
}

Expand Down

0 comments on commit 357b5e4

Please sign in to comment.