diff --git a/.github/workflows/go_lint.yml b/.github/workflows/go_lint.yml index 5862c0a5c..73de86c88 100644 --- a/.github/workflows/go_lint.yml +++ b/.github/workflows/go_lint.yml @@ -14,10 +14,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Set up Go ^1.19 + - name: Set up Go 1.20 uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version: '1.20' - name: Check out code into the Go module directory uses: actions/checkout@v3 diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml index 6fd77b8dc..a3cd2363b 100644 --- a/.github/workflows/go_test.yml +++ b/.github/workflows/go_test.yml @@ -19,10 +19,10 @@ jobs: env: LLVL: trace steps: - - name: Set up Go ^1.19 + - name: Set up Go '1.20' uses: actions/setup-go@v3 with: - go-version: ^1.19 + go-version: '1.20' - name: Check out code into the Go module directory uses: actions/checkout@v3 diff --git a/core/ordering/cosipbft/contracts/viewchange/viewchange_test.go b/core/ordering/cosipbft/contracts/viewchange/viewchange_test.go index 1f718ff81..2a21083a4 100644 --- a/core/ordering/cosipbft/contracts/viewchange/viewchange_test.go +++ b/core/ordering/cosipbft/contracts/viewchange/viewchange_test.go @@ -22,7 +22,7 @@ func TestRegisterContract(t *testing.T) { } func TestNewTransaction(t *testing.T) { - mgr := NewManager(signed.NewManager(fake.NewSigner(), nil)) + mgr := NewManager(signed.NewManager(fake.NewSigner(), fake.NewClient())) tx, err := mgr.Make(authority.New(nil, nil)) require.NoError(t, err) diff --git a/core/ordering/cosipbft/cosipbft_test.go b/core/ordering/cosipbft/cosipbft_test.go index 3efaeb12c..44c9eb030 100644 --- a/core/ordering/cosipbft/cosipbft_test.go +++ b/core/ordering/cosipbft/cosipbft_test.go @@ -175,7 +175,7 @@ func TestService_Scenario_ViewChange_Request(t *testing.T) { require.Equal(t, leader, nodes[0].onet.GetAddress()) // let enough time for a round to run - time.Sleep(DefaultRoundTimeout + 100*time.Millisecond) + time.Sleep(time.Second) require.Equal(t, nodes[3].service.pbftsm.GetState(), pbft.ViewChangeState) require.NotEqual(t, nodes[2].service.pbftsm.GetState(), pbft.ViewChangeState) @@ -214,7 +214,7 @@ func TestService_Scenario_ViewChange_NoRequest(t *testing.T) { require.NoError(t, err) // let enough time for a round to run - time.Sleep(DefaultRoundTimeout + 100*time.Millisecond) + time.Sleep(time.Second) require.NotEqual(t, nodes[3].service.pbftsm.GetState(), pbft.ViewChangeState) require.NotEqual(t, nodes[2].service.pbftsm.GetState(), pbft.ViewChangeState) diff --git a/core/txn/signed/signed_test.go b/core/txn/signed/signed_test.go index b8c47227a..d32ac180b 100644 --- a/core/txn/signed/signed_test.go +++ b/core/txn/signed/signed_test.go @@ -160,7 +160,7 @@ func TestTransactionFactory_Deserialize(t *testing.T) { } func TestManager_Make(t *testing.T) { - mgr := NewManager(fake.NewSigner(), nil) + mgr := NewManager(fake.NewSigner(), fake.NewClient()) tx, err := mgr.Make(txn.Arg{Key: "a", Value: []byte{1, 2, 3}}) require.NoError(t, err) diff --git a/test/cosidela_test.go b/test/cosidela_test.go index 9bafad70a..d45d0928d 100644 --- a/test/cosidela_test.go +++ b/test/cosidela_test.go @@ -399,16 +399,13 @@ func (a accessstore) Delete(key []byte) error { return nil } -// txClient return monotically increasing nonce +// txClient returns always a 0 nonce // // - implements signed.Client type txClient struct { - nonce uint64 } // GetNonce implements signed.Client func (c *txClient) GetNonce(access.Identity) (uint64, error) { - res := c.nonce - c.nonce++ - return res, nil + return 0, nil } diff --git a/test/integration_test.go b/test/integration_test.go index 1b53375ce..9c86d3212 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -122,9 +122,6 @@ func addAndWait( node cosiDelaNode, args ...txn.Arg, ) error { - err := manager.Sync() - require.NoError(t, err) - tx, err := manager.Make(args...) if err != nil { return xerrors.Errorf("failed to make tx: %v", err) diff --git a/testing/fake/crypto.go b/testing/fake/crypto.go index 90a3f5acb..5fd36dc57 100644 --- a/testing/fake/crypto.go +++ b/testing/fake/crypto.go @@ -3,6 +3,7 @@ package fake import ( "hash" + "go.dedis.ch/dela/core/access" "go.dedis.ch/dela/crypto" "go.dedis.ch/dela/serde" ) @@ -253,6 +254,19 @@ func (s Signer) Aggregate(...crypto.Signature) (crypto.Signature, error) { return Signature{}, s.err } +type Client struct { + nonce uint64 +} + +// NewClient returns a fake client +func NewClient() Client { + return Client{} +} + +func (c Client) GetNonce(access.Identity) (uint64, error) { + return c.nonce, nil +} + // Verifier is a fake implementation of crypto.Verifier. // // - implements crypto.Verifier