Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
5 changes: 3 additions & 2 deletions aggsender/aggsender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAggSenderStart(t *testing.T) {
aggLayerMock.EXPECT().GetLatestPendingCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil)
aggLayerMock.EXPECT().GetLatestSettledCertificateHeader(mock.Anything, mock.Anything).Return(nil, nil)
rollupQuerierMock.EXPECT().GetRollupChainID().Return(uint64(1234), nil)
committee, err := aggsendertypes.NewMultisigCommittee([]*aggsendertypes.SignerInfo{aggsendertypes.NewSignerInfo("", common.Address{})}, 1)
committee, err := aggsendertypes.NewMultisigCommittee([]*aggsendertypes.SignerInfo{aggsendertypes.NewSignerInfo("", common.Address{})}, big.NewInt(1))
require.NoError(t, err)
committeQuerierMock.EXPECT().GetMultisigCommittee(mock.Anything, mock.Anything).Return(committee, nil).Once()

Expand Down Expand Up @@ -500,7 +500,8 @@ func TestNewAggSender(t *testing.T) {
mockCommitteeQuerier := mocks.NewMultisigQuerier(t)
mockBridgeSyncer.EXPECT().OriginNetwork().Return(uint32(1)).Times(2)
mockRollupQuerier.EXPECT().GetRollupChainID().Return(uint64(1234), nil)
committee, err := aggsendertypes.NewMultisigCommittee([]*aggsendertypes.SignerInfo{aggsendertypes.NewSignerInfo("", common.Address{})}, 1)
committee, err := aggsendertypes.NewMultisigCommittee([]*aggsendertypes.SignerInfo{aggsendertypes.NewSignerInfo("", common.Address{})},
big.NewInt(1))
require.NoError(t, err)
mockCommitteeQuerier.EXPECT().GetMultisigCommittee(mock.Anything, mock.Anything).Return(committee, nil).Once()

Expand Down
14 changes: 7 additions & 7 deletions aggsender/flows/factory_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package flows

import (
"context"
"errors"
"math/big"
"testing"
"time"

Expand Down Expand Up @@ -40,7 +40,7 @@ func TestNewFlow(t *testing.T) {
AggkitProverClient: aggkitgrpc.DefaultConfig(),
},
mockFn: func(mockCommittee *mocks.MultisigQuerier) {
committee, err := types.NewMultisigCommittee([]*types.SignerInfo{types.NewSignerInfo("", common.Address{})}, 1)
committee, err := types.NewMultisigCommittee([]*types.SignerInfo{types.NewSignerInfo("", common.Address{})}, big.NewInt(1))
require.NoError(t, err)

mockCommittee.EXPECT().GetMultisigCommittee(mock.Anything, mock.Anything).Return(committee, nil).Maybe()
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestNewFlow(t *testing.T) {
types.NewSignerInfo("http://signer4", common.HexToAddress("0x4444444444444444444444444444444444")),
}

committee, err := types.NewMultisigCommittee(signers, 2)
committee, err := types.NewMultisigCommittee(signers, big.NewInt(2))
require.NoError(t, err)
mockCommittee.EXPECT().GetMultisigCommittee(mock.Anything, mock.Anything).Return(committee, nil).Maybe()
},
Expand All @@ -110,7 +110,7 @@ func TestNewFlow(t *testing.T) {
types.NewSignerInfo("http://signer4", common.HexToAddress("0x4444444444444444444444444444444444444444")),
}

committee, err := types.NewMultisigCommittee(signers, 2)
committee, err := types.NewMultisigCommittee(signers, big.NewInt(2))
require.NoError(t, err)
mockCommittee.EXPECT().GetMultisigCommittee(mock.Anything, mock.Anything).Return(committee, nil).Maybe()
},
Expand All @@ -135,7 +135,7 @@ func TestNewFlow(t *testing.T) {
expectedError: "unsupported Aggsender mode: unsupported-mode",
},
{
name: "error optimistic mode creating TrustedSequencerContract AggchainProofMode",
name: "error optimistic mode fetching aggchain signers in AggchainProofMode",
cfg: config.Config{
Mode: string(types.AggchainProofMode),
AggsenderPrivateKey: keyConfig,
Expand All @@ -148,14 +148,14 @@ func TestNewFlow(t *testing.T) {
RequireKeyMatchTrustedSequencer: true,
},
},
expectedError: "error aggchainFEPContract",
expectedError: "failed to fetch the aggchain signers from the AggchainFEP contract",
},
}

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ctx := context.Background()
ctx := t.Context()

mockStorage := mocks.NewAggSenderStorage(t)
mockL1Client := typesmocks.NewBaseEthereumClienter(t)
Expand Down
2 changes: 1 addition & 1 deletion aggsender/flows/flow_aggchain_prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"

"github.com/0xPolygon/cdk-contracts-tooling/contracts/pp/l2-sovereign-chain/aggchainfep"
"github.com/0xPolygon/cdk-contracts-tooling/contracts/fep/aggchain-ecdsa-multisig/aggchainfep"
agglayertypes "github.com/agglayer/aggkit/agglayer/types"
"github.com/agglayer/aggkit/aggsender/db"
"github.com/agglayer/aggkit/aggsender/query"
Expand Down
2 changes: 1 addition & 1 deletion aggsender/flows/flow_aggchain_prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/0xPolygon/cdk-contracts-tooling/contracts/pp/l2-sovereign-chain/aggchainfep"
"github.com/0xPolygon/cdk-contracts-tooling/contracts/fep/aggchain-ecdsa-multisig/aggchainfep"
agglayertypes "github.com/agglayer/aggkit/agglayer/types"
"github.com/agglayer/aggkit/aggsender/mocks"
"github.com/agglayer/aggkit/aggsender/query"
Expand Down
232 changes: 232 additions & 0 deletions aggsender/mocks/mock_aggchain_fep_caller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading