refactor: move filter and fetch to pkg

This commit is contained in:
Mohamed Sohail 2023-01-14 09:20:16 +00:00
parent f791b87172
commit 02e31146cc
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
14 changed files with 12 additions and 14 deletions

View File

@ -1 +0,0 @@
export TEST_GRAPHQL_ENDPOINT=

View File

@ -13,6 +13,5 @@ mod:
go mod tidy
go mod verify
test:
source .env.test
go test -v -covermode atomic -coverprofile=covprofile ./internal/...
test-pkg:
TEST_GRAPHQL_ENDPOINT=https://rpc.alfajores.celo.grassecon.net/graphql go test -v -covermode atomic -coverprofile=covprofile ./pkg/...

View File

@ -1,7 +1,7 @@
package main
import (
"github.com/grassrootseconomics/cic-chain-events/internal/filter"
"github.com/grassrootseconomics/cic-chain-events/pkg/filter"
)
func initAddressFilter() filter.Filter {

View File

@ -5,9 +5,9 @@ import (
"strings"
"github.com/alitto/pond"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/internal/pool"
"github.com/grassrootseconomics/cic-chain-events/internal/store"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/jackc/pgx/v5"
"github.com/knadh/goyesql/v2"
"github.com/knadh/koanf"

View File

@ -11,9 +11,9 @@ import (
"time"
"github.com/grassrootseconomics/cic-chain-events/internal/api"
"github.com/grassrootseconomics/cic-chain-events/internal/filter"
"github.com/grassrootseconomics/cic-chain-events/internal/pipeline"
"github.com/grassrootseconomics/cic-chain-events/internal/syncer"
"github.com/grassrootseconomics/cic-chain-events/pkg/filter"
"github.com/knadh/goyesql/v2"
"github.com/knadh/koanf"
"github.com/zerodha/logf"

View File

@ -3,9 +3,9 @@ package pipeline
import (
"context"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/internal/filter"
"github.com/grassrootseconomics/cic-chain-events/internal/store"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/filter"
"github.com/jackc/pgx/v5"
"github.com/zerodha/logf"
)

View File

@ -5,7 +5,7 @@ import (
"sync"
celo "github.com/grassrootseconomics/cic-celo-sdk"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/zerodha/logf"
)

View File

@ -5,7 +5,7 @@ import (
"sync"
"testing"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/stretchr/testify/suite"
"github.com/zerodha/logf"
)

View File

@ -5,7 +5,7 @@ import (
"math/big"
"github.com/celo-org/celo-blockchain/common"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/grassrootseconomics/w3-celo-patch"
"github.com/zerodha/logf"
)

View File

@ -4,7 +4,7 @@ import (
"context"
"testing"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
"github.com/stretchr/testify/suite"
"github.com/zerodha/logf"
)

View File

@ -3,7 +3,7 @@ package filter
import (
"context"
"github.com/grassrootseconomics/cic-chain-events/internal/fetch"
"github.com/grassrootseconomics/cic-chain-events/pkg/fetch"
)
// Filter defines a read only filter which must return next as true/false or an error