Skip to content

Commit

Permalink
fix: p2p after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed May 3, 2024
1 parent 932ac47 commit f1cbbed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 1 addition & 6 deletions p2p/pkg/preconfirmation/preconfirmation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 2 additions & 0 deletions p2p/pkg/preconfirmation/preconfirmation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -85,6 +86,7 @@ func (t *testCommitmentDA) StoreEncryptedCommitment(
_ context.Context,
_ []byte,
_ []byte,
_ uint64,
) (common.Hash, error) {
return common.Hash{}, nil
}
Expand Down
8 changes: 4 additions & 4 deletions p2p/pkg/preconfirmation/tracker/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down Expand Up @@ -342,7 +342,7 @@ func publishEncCommitment(
ec.Commiter,
ec.CommitmentDigest,
ec.CommitmentSignature,
ec.BlockCommitedAt,
ec.DispatchTimestamp,
)
if err != nil {
return err
Expand Down Expand Up @@ -382,7 +382,7 @@ func publishCommitment(
c.CommitmentHash,
c.BidSignature,
c.CommitmentSignature,
c.BlockCommitedAt,
c.DispatchTimestamp,
c.SharedSecretKey,
)
if err != nil {
Expand Down

0 comments on commit f1cbbed

Please sign in to comment.