Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Nov 16, 2023
1 parent dc63568 commit cceced0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
10 changes: 3 additions & 7 deletions integration/networktest/actions/l1/important_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package l1

import (
"context"
"fmt"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/obscuronet/go-obscuro/go/common/retry"
Expand All @@ -11,7 +12,6 @@ import (
"github.com/obscuronet/go-obscuro/integration/common/testlog"
"github.com/obscuronet/go-obscuro/integration/networktest"
"github.com/pkg/errors"
"time"
)

type setImportantContract struct {
Expand Down Expand Up @@ -86,23 +86,19 @@ func (s *setImportantContract) Run(ctx context.Context, network networktest.Netw
}, retry.NewTimeoutStrategy(15*time.Second, 1*time.Second))
}

func (s *setImportantContract) Verify(ctx context.Context, network networktest.NetworkConnector) error {
func (s *setImportantContract) Verify(_ context.Context, network networktest.NetworkConnector) error {
cli, err := obsclient.Dial(network.ValidatorRPCAddress(0))
if err != nil {
return errors.Wrap(err, "failed to dial obsClient")
}
networkCfg, err := cli.GetConfig()
fmt.Println("networkCfg: ", networkCfg)
if err != nil {
return errors.Wrap(err, "failed to get network config")
}

if networkCfg.ImportantContracts == nil || len(networkCfg.ImportantContracts) == 0 {
return errors.New("no important contracts set")
}
if len(networkCfg.ImportantContracts) > 1 {
return errors.New("more than one important contract set")
}
if addr, ok := networkCfg.ImportantContracts[s.contractKey]; !ok || addr != s.contractAddress {
return errors.New("important contract not set")
}
Expand Down
3 changes: 2 additions & 1 deletion integration/networktest/env/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/obscuronet/go-obscuro/go/wallet"
"math/big"
"net/http"
"time"

"github.com/obscuronet/go-obscuro/go/wallet"

"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/obscuronet/go-obscuro/integration/networktest/userwallet"
Expand Down
1 change: 1 addition & 0 deletions integration/networktest/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package networktest

import (
"context"

"github.com/obscuronet/go-obscuro/go/wallet"

"github.com/obscuronet/go-obscuro/go/ethadapter"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package bridge

import (
"testing"

gethcommon "github.com/ethereum/go-ethereum/common"
"github.com/obscuronet/go-obscuro/integration/networktest"
"github.com/obscuronet/go-obscuro/integration/networktest/actions"
"github.com/obscuronet/go-obscuro/integration/networktest/actions/l1"
"github.com/obscuronet/go-obscuro/integration/networktest/env"
"testing"
)

func TestImportantContractsLookup(t *testing.T) {
Expand Down

0 comments on commit cceced0

Please sign in to comment.