Skip to content

Commit

Permalink
feat: resolves all issues with updater
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik committed Jul 8, 2024
1 parent 3204cd3 commit fb18f26
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions oracle/pkg/updater/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ func TestUpdater(t *testing.T) {
DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()),
DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()),
DispatchTimestamp: uint64(midTimestamp.UnixMilli()),
RevertingTxHashes: "",
SharedSecretKey: []byte("shared_secret_key"),
}

if i%2 == 0 {
Expand Down Expand Up @@ -173,6 +175,8 @@ func TestUpdater(t *testing.T) {
DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()),
DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()),
DispatchTimestamp: uint64(midTimestamp.UnixMilli()),
RevertingTxHashes: "",
SharedSecretKey: []byte("shared_secret_key"),
}
encCommitments = append(encCommitments, encCommitment)
commitments = append(commitments, commitment)
Expand Down Expand Up @@ -392,6 +396,8 @@ func TestUpdaterRevertedTxns(t *testing.T) {
DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()),
DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()),
DispatchTimestamp: uint64(midTimestamp.UnixMilli()),
RevertingTxHashes: "",
SharedSecretKey: []byte("shared_secret_key"),
}

if i%2 == 0 {
Expand Down Expand Up @@ -434,6 +440,8 @@ func TestUpdaterRevertedTxns(t *testing.T) {
DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()),
DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()),
DispatchTimestamp: uint64(midTimestamp.UnixMilli()),
RevertingTxHashes: "",
SharedSecretKey: []byte("shared_secret_key"),
}
encCommitments = append(encCommitments, encCommitment)
commitments = append(commitments, commitment)
Expand Down Expand Up @@ -657,6 +665,8 @@ func TestUpdaterBundlesFailure(t *testing.T) {
DecayStartTimeStamp: uint64(startTimestamp.UnixMilli()),
DecayEndTimeStamp: uint64(endTimestamp.UnixMilli()),
DispatchTimestamp: uint64(midTimestamp.UnixMilli()),
RevertingTxHashes: "",
SharedSecretKey: []byte("shared_secret_key"),
}

commitments = append(commitments, commitment)
Expand Down Expand Up @@ -841,6 +851,7 @@ func TestUpdaterIgnoreCommitments(t *testing.T) {
Commiter: builderAddr,
Bid: big.NewInt(10),
TxnHash: strings.TrimPrefix(txn.Hash().Hex(), "0x"),
RevertingTxHashes: "",
BlockNumber: blockNum,
CommitmentHash: common.HexToHash(fmt.Sprintf("0x%02d", i)),
CommitmentSignature: []byte("signature"),
Expand Down Expand Up @@ -1203,6 +1214,7 @@ func publishCommitment(
c.DecayStartTimeStamp,
c.DecayEndTimeStamp,
c.TxnHash,
c.RevertingTxHashes,
c.CommitmentHash,
c.BidSignature,
c.CommitmentSignature,
Expand Down

0 comments on commit fb18f26

Please sign in to comment.