Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Tangui-Bitfly committed Jan 29, 2025
1 parent 3c6a22a commit 06801e4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 30 deletions.
5 changes: 3 additions & 2 deletions backend/cmd/eth1indexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import (
"io"
"math/big"
"net/http"
//nolint:gosec
_ "net/http/pprof"
"os"
"strconv"
"strings"
Expand All @@ -37,6 +35,9 @@ import (
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/shopspring/decimal"
"golang.org/x/sync/errgroup"

//nolint:gosec
_ "net/http/pprof"
)

func Run() {
Expand Down
15 changes: 0 additions & 15 deletions backend/pkg/commons/db/bigtable_eth1.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/coocood/freecache"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -2865,20 +2864,6 @@ func prefixSuccessor(prefix string, pos int) string {
return string(ans)
}

func (bigtable *Bigtable) markBalanceUpdate(address []byte, token []byte, mutations *types.BulkMutations, cache *freecache.Cache) {
balanceUpdateKey := fmt.Sprintf("%s:B:%x", bigtable.chainId, address) // format is B: for balance update as chainid:prefix:address (token id will be encoded as column name)
balanceUpdateCacheKey := []byte(fmt.Sprintf("%s:B:%x:%x", bigtable.chainId, address, token)) // format is B: for balance update as chainid:prefix:address (token id will be encoded as column name)
if _, err := cache.Get(balanceUpdateCacheKey); err != nil {
mut := gcp_bigtable.NewMutation()
mut.Set(DEFAULT_FAMILY, fmt.Sprintf("%x", token), gcp_bigtable.Timestamp(0), []byte{})

mutations.Keys = append(mutations.Keys, balanceUpdateKey)
mutations.Muts = append(mutations.Muts, mut)

_ = cache.Set(balanceUpdateCacheKey, []byte{0x1}, int((utils.Day * 2).Seconds()))
}
}

var (
GASNOW_RAPID_COLUMN = "RAPI"
GASNOW_FAST_COLUMN = "FAST"
Expand Down
14 changes: 7 additions & 7 deletions backend/pkg/commons/db2/data/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ type Option interface {
}

type options struct {
from, to *timestamp.Timestamp
method *string
chainID *string
onlySent bool
onlyReceived bool
asset *common.Address
with *common.Address
from, to *timestamp.Timestamp
method *string
// chainID *string
onlySent bool
onlyReceived bool
asset *common.Address
//with *common.Address
onlyTxs bool
onlyTransfers bool
statsReporter func(msg string, args ...any)
Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/commons/rpc/erigon.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
gethrpc "github.com/ethereum/go-ethereum/rpc"
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/types/known/timestamppb"

"github.com/gobitfly/beaconchain/pkg/commons/contracts/oneinchoracle"
"github.com/gobitfly/beaconchain/pkg/commons/erc20"
"github.com/gobitfly/beaconchain/pkg/commons/log"
Expand Down
5 changes: 2 additions & 3 deletions backend/pkg/executionlayer/indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func TestIndexer(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
defer dataBigtable.Clear()
defer metadataBigtable.Clear()
defer func() { _ = dataBigtable.Clear() }()
defer func() { _ = metadataBigtable.Clear() }()

indexer := NewIndexer(
data.NewStore(database.Wrap(dataBigtable, data.Table)),
Expand Down Expand Up @@ -185,7 +185,6 @@ func rowsContains(rows []database.Row, keys []string) error {
for _, key := range keys {
found := false
for _, row := range rows {
fmt.Println(row.Key)
if strings.Contains(row.Key, key) {
found = true
break
Expand Down
2 changes: 0 additions & 2 deletions backend/pkg/executionlayer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,7 @@ func (t *Transformer) Blob(chainID string, block *types.Eth1Block) (map[string][
}

func (t *Transformer) Contract(chainID string, block *types.Eth1Block) (map[string][]database.Item, map[string][]database.Item, error) {
updateMetadata := make(map[string][]database.Item)
var updates []metadataupdates.ContractUpdateWithAddress

for i, tx := range block.GetTransactions() {
for j, itx := range tx.GetItx() {
if itx.GetType() == "create" || itx.GetType() == "suicide" {
Expand Down

0 comments on commit 06801e4

Please sign in to comment.