Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: securego/gosec@v2.19.0
- uses: securego/gosec@v2.24.7
with:
args: ./...

Expand Down
3 changes: 1 addition & 2 deletions pkg/chain/ethereum/block_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (bc *BlockCounter) WatchBlocks(ctx context.Context) <-chan uint64 {
// waited on a message will be sent.
func (bc *BlockCounter) receiveBlocks() {
for block := range bc.subscriptionChannel {
topBlockNumber, err := strconv.ParseInt(block.Number, 0, 32)
receivedBlockHeight, err := strconv.ParseUint(block.Number, 0, 64)
if err != nil {
logger.Errorf("error receiving a new block: [%v]", err)
continue
Expand All @@ -111,7 +111,6 @@ func (bc *BlockCounter) receiveBlocks() {
// If we have already received notification about this block,
// we do nothing. All handlers were already called for this block
// height.
receivedBlockHeight := uint64(topBlockNumber)
if receivedBlockHeight == bc.latestBlockHeight {
continue
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/chain/ethereum/ethutil/rate_limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,15 @@ func (mec *mockEthereumClient) TransactionReceipt(
return nil, nil
}

func (mec *mockEthereumClient) SubscribeTransactionReceipts(
ctx context.Context,
q *ethereum.TransactionReceiptsQuery,
ch chan<- []*types.Receipt,
) (ethereum.Subscription, error) {
mec.mockRequest()
return nil, nil
}

func (mec *mockEthereumClient) BalanceAt(
ctx context.Context,
account common.Address,
Expand Down
3 changes: 2 additions & 1 deletion pkg/chain/ethereum/ethutil/resubscribe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package ethutil

import (
"context"
"errors"
"fmt"
"testing"
"time"
Expand All @@ -18,7 +19,7 @@ func TestEmitOriginalError(t *testing.T) {
subscribeFn := func(ctx context.Context) (event.Subscription, error) {
if !failedOnce {
failedOnce = true
return nil, fmt.Errorf(expectedFailMessage)
return nil, errors.New(expectedFailMessage)
}
delegate := event.NewSubscription(func(unsubscribed <-chan struct{}) error {
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/persistence/disk_persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func CheckStoragePermission(dirBasePath string) error {
func EnsureDirectoryExists(dirBasePath, newDirName string) error {
dirPath := filepath.Join(dirBasePath, newDirName)
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
err = os.Mkdir(dirPath, os.ModePerm)
err = os.Mkdir(dirPath, 0o750)
if err != nil {
return fmt.Errorf(
"error occurred while creating a dir: [%w]; "+
Expand Down
4 changes: 2 additions & 2 deletions tools/generators/promise/promise.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func main() {
flag.Parse()

if *doHelp {
fmt.Printf(helpText(path.Base(os.Args[0])))
fmt.Print(helpText(path.Base(os.Args[0])))
os.Exit(0)
}

Expand All @@ -58,7 +58,7 @@ func main() {
}

func errorAndExit(err string) {
fmt.Fprintf(os.Stderr, err+"\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", err)
fmt.Println(helpText(path.Base(os.Args[0])))

os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions tools/generators/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {

templateFile := os.Args[templateFileArgIndex]

// #nosec G304 (file path provided as taint input)
// #nosec G304 G703 (file path provided as taint input)
// This line is placed in the auxiliary generator code,
// not in the core application. User input has to be passed to provide a
// path to the template file.
Expand Down Expand Up @@ -77,7 +77,7 @@ func main() {
}

func errorAndExit(err string) {
fmt.Fprintf(os.Stderr, err+"\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", err)
fmt.Println(helpText(os.Args[0]))

os.Exit(1)
Expand Down
Loading