From f1cbbedbcb90dffa27ec112ce5ee74565708a8d0 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Fri, 3 May 2024 13:46:19 +0200 Subject: [PATCH] fix: p2p after merge --- p2p/pkg/preconfirmation/preconfirmation.go | 7 +------ p2p/pkg/preconfirmation/preconfirmation_test.go | 2 ++ p2p/pkg/preconfirmation/tracker/tracker_test.go | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/p2p/pkg/preconfirmation/preconfirmation.go b/p2p/pkg/preconfirmation/preconfirmation.go index 8d05cf200..aed8329fa 100644 --- a/p2p/pkg/preconfirmation/preconfirmation.go +++ b/p2p/pkg/preconfirmation/preconfirmation.go @@ -64,17 +64,12 @@ type Tracker interface { TrackCommitment(ctx context.Context, cm *store.EncryptedPreConfirmationWithDecrypted) error } -type DepositManager interface { - Start(ctx context.Context) <-chan struct{} - CheckAndDeductDeposit(ctx context.Context, ethAddress common.Address, bidAmount string, blockNumber int64) (*big.Int, error) - RefundDeposit(ethAddress common.Address, amount *big.Int, blockNumber int64) error -} - type PreconfContract interface { StoreEncryptedCommitment( ctx context.Context, commitmentDigest []byte, commitmentSignature []byte, + dispatchTimestamp uint64, ) (common.Hash, error) } diff --git a/p2p/pkg/preconfirmation/preconfirmation_test.go b/p2p/pkg/preconfirmation/preconfirmation_test.go index 8b944edf5..1ab23f7cb 100644 --- a/p2p/pkg/preconfirmation/preconfirmation_test.go +++ b/p2p/pkg/preconfirmation/preconfirmation_test.go @@ -19,6 +19,7 @@ import ( "github.com/primevprotocol/mev-commit/p2p/pkg/p2p" p2ptest "github.com/primevprotocol/mev-commit/p2p/pkg/p2p/testing" "github.com/primevprotocol/mev-commit/p2p/pkg/preconfirmation" + providerapi "github.com/primevprotocol/mev-commit/p2p/pkg/rpc/provider" "github.com/primevprotocol/mev-commit/p2p/pkg/store" "github.com/primevprotocol/mev-commit/p2p/pkg/topology" ) @@ -85,6 +86,7 @@ func (t *testCommitmentDA) StoreEncryptedCommitment( _ context.Context, _ []byte, _ []byte, + _ uint64, ) (common.Hash, error) { return common.Hash{}, nil } diff --git a/p2p/pkg/preconfirmation/tracker/tracker_test.go b/p2p/pkg/preconfirmation/tracker/tracker_test.go index 22f7ca4af..b97af7ef8 100644 --- a/p2p/pkg/preconfirmation/tracker/tracker_test.go +++ b/p2p/pkg/preconfirmation/tracker/tracker_test.go @@ -119,7 +119,7 @@ func TestTracker(t *testing.T) { CommitmentIndex: common.BytesToHash(c.EncryptedPreConfirmation.CommitmentIndex), CommitmentDigest: common.BytesToHash(c.EncryptedPreConfirmation.Commitment), CommitmentSignature: c.EncryptedPreConfirmation.Signature, - BlockCommitedAt: big.NewInt(1), + DispatchTimestamp: uint64(1), }) if err != nil { t.Fatal(err) @@ -145,7 +145,7 @@ func TestTracker(t *testing.T) { CommitmentHash: common.BytesToHash(commitments[4].PreConfirmation.Digest), BidSignature: commitments[4].PreConfirmation.Bid.Signature, CommitmentSignature: commitments[4].PreConfirmation.Signature, - BlockCommitedAt: big.NewInt(1), + DispatchTimestamp: uint64(1), SharedSecretKey: commitments[4].PreConfirmation.SharedSecret, }) if err != nil { @@ -342,7 +342,7 @@ func publishEncCommitment( ec.Commiter, ec.CommitmentDigest, ec.CommitmentSignature, - ec.BlockCommitedAt, + ec.DispatchTimestamp, ) if err != nil { return err @@ -382,7 +382,7 @@ func publishCommitment( c.CommitmentHash, c.BidSignature, c.CommitmentSignature, - c.BlockCommitedAt, + c.DispatchTimestamp, c.SharedSecretKey, ) if err != nil {