Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Mar 21, 2024
1 parent 12aad0a commit 1c7048f
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 136 deletions.
174 changes: 121 additions & 53 deletions gen/go/bidderapi/v1/bidderapi.pb.go

Large diffs are not rendered by default.

86 changes: 54 additions & 32 deletions gen/go/preconfirmation/v1/preconfirmation.pb.go

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

52 changes: 46 additions & 6 deletions gen/go/providerapi/v1/providerapi.pb.go

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

2 changes: 2 additions & 0 deletions messages/preconfirmation/v1/preconfirmation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ message Bid {
int64 block_number = 3;
bytes digest = 4;
bytes signature = 5;
int64 decay_start_timestamp = 6;
int64 decay_end_timestamp = 7;
};

message PreConfirmation {
Expand Down
4 changes: 2 additions & 2 deletions pkg/preconfirmation/preconfirmation.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func (p *Preconfirmation) handleBid(
bidAmt,
uint64(preConfirmation.Bid.BlockNumber),
preConfirmation.Bid.TxHash,
uint64(preConfirmation.Bid.DecayStartTimeStamp),
uint64(preConfirmation.Bid.DecayEndTimeStamp),
uint64(preConfirmation.Bid.DecayStartTimestamp),
uint64(preConfirmation.Bid.DecayEndTimestamp),
preConfirmation.Bid.Signature,
preConfirmation.Signature,
)
Expand Down
22 changes: 9 additions & 13 deletions pkg/preconfirmation/preconfirmation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ type testSigner struct {
preConfirmationSigner common.Address
}

<<<<<<< HEAD
func (t *testSigner) ConstructSignedBid(_ string, _ *big.Int, _ *big.Int, _ *big.Int, _ *big.Int) (*preconfsigner.Bid, error) {
=======
func (t *testSigner) ConstructSignedBid(_ string, _ string, _ int64) (*preconfpb.Bid, error) {
>>>>>>> d4e267e (feat: integrate new libp2p messages)
func (t *testSigner) ConstructSignedBid(_ string, _ string, _ int64, _ int64, _ int64) (*preconfpb.Bid, error) {
return t.bid, nil
}

Expand Down Expand Up @@ -114,13 +110,13 @@ func TestPreconfBidSubmission(t *testing.T) {
}

bid := &preconfpb.Bid{
TxHash: "test",
BidAmount: "10",
BlockNumber: 10,
DecayStartTimeStamp: time.Now().UnixMilli() - 10000*time.Millisecond.Milliseconds(),
DecayEndTimeStamp: time.Now().UnixMilli(),
Digest: []byte("test"),
Signature: []byte("test"),
TxHash: "test",
BidAmount: "10",
BlockNumber: 10,
DecayStartTimestamp: time.Now().UnixMilli() - 10000*time.Millisecond.Milliseconds(),
DecayEndTimestamp: time.Now().UnixMilli(),
Digest: []byte("test"),
Signature: []byte("test"),
}

preConfirmation := &preconfpb.PreConfirmation{
Expand Down Expand Up @@ -157,7 +153,7 @@ func TestPreconfBidSubmission(t *testing.T) {

svc.SetPeerHandler(server, p.Streams()[0])

respC, err := p.SendBid(context.Background(), bid.TxHash, bid.BidAmt, bid.BlockNumber, bid.DecayStartTimeStamp, bid.DecayEndTimeStamp)
respC, err := p.SendBid(context.Background(), bid.TxHash, bid.BidAmount, bid.BlockNumber, bid.DecayStartTimestamp, bid.DecayEndTimestamp)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpc/bidder/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ func (s *testSender) SendBid(
TxHash: txHex,
BidAmount: amount,
BlockNumber: blockNum,
DecayStartTimeStamp: decayStartTimestamp,
DecayEndTimeStamp: decayEndTimestamp,
DecayStartTimestamp: decayStartTimestamp,
DecayEndTimestamp: decayEndTimestamp,
Digest: []byte("digest"),
Signature: []byte("signature"),
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpc/provider/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func (s *Service) ProcessBid(
BidAmount: bid.BidAmount,
BlockNumber: bid.BlockNumber,
BidDigest: bid.Digest,
DecayStartTimestamp: bid.DecayStartTimeStamp,
DecayEndTimestamp: bid.DecayEndTimeStamp,
DecayStartTimestamp: bid.DecayStartTimestamp,
DecayEndTimestamp: bid.DecayEndTimestamp,
}

err := s.validator.Validate(bidMsg)
Expand Down
24 changes: 12 additions & 12 deletions pkg/rpc/provider/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 1,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
status: providerapiv1.BidResponse_STATUS_ACCEPTED,
},
Expand All @@ -214,8 +214,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 1,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
status: providerapiv1.BidResponse_STATUS_REJECTED,
},
Expand All @@ -227,8 +227,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 1,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
status: providerapiv1.BidResponse_STATUS_UNSPECIFIED,
noStatus: true,
Expand All @@ -241,8 +241,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 1,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
processErr: "tx_hashes: tx_hashes must be a valid array of transaction hashes",
},
Expand All @@ -254,8 +254,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 1,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
processErr: "bid_amount: bid_amount must be a valid integer",
},
Expand All @@ -267,8 +267,8 @@ func TestBidHandling(t *testing.T) {
BlockNumber: 0,
Digest: []byte("digest"),
Signature: []byte("signature"),
DecayStartTimeStamp: 199,
DecayEndTimeStamp: 299,
DecayStartTimestamp: 199,
DecayEndTimestamp: 299,
},
processErr: "block_number: value must be greater than 0",
},
Expand Down
Loading

0 comments on commit 1c7048f

Please sign in to comment.