Skip to content

Commit

Permalink
test: update datanode unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Elias Van Ootegem <[email protected]>
  • Loading branch information
EVODelavega committed Apr 18, 2024
1 parent 7ebde91 commit fcdbccf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions datanode/networkhistory/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,12 @@ func TestMain(t *testing.M) {
log.Infof("%s", goldenSourceHistorySegment[4000].HistorySegmentID)
log.Infof("%s", goldenSourceHistorySegment[5000].HistorySegmentID)

panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[1000].HistorySegmentID, "QmbpJgGrF77bRNDFfJGvLpnUZ8pNHjyxNrDKsjj1qHRRVT", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2000].HistorySegmentID, "QmQEkwKQeLAaEeDjTRzYcSHwfqzHPceVXMsF2w2aBYMJuS", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2500].HistorySegmentID, "QmRfbQDZzJKBbaiDZpSvjbVv3NNN5aGkWrcpo3fZTEfYv4", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[3000].HistorySegmentID, "QmQbtFz37HMrM5rgKmQ2Em4YmbADj7bgCFDBDjj1wy5KQS", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[4000].HistorySegmentID, "QmUWDmXwPxkyg7ZaXhg6znZUSyndB35u8okMV1MhQYSSz8", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[5000].HistorySegmentID, "QmYdufkLtNRYDA4zmbFirtkVuNG4z4Hs1hidjpKRhcjsN5", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[1000].HistorySegmentID, "QmRM4ANS2j6wShYt9SS2njiPT1JWhZFWJCgTqxt27xz2ys", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2000].HistorySegmentID, "QmVHoDCYhP8cLqpjZKgGtKVLQdHCuqAkumiWmNNkqjZyqs", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2500].HistorySegmentID, "QmYC6vk2VKFjkZ46MhYYPMF3RMqoN2pSMucN3vZHRYWBus", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[3000].HistorySegmentID, "QmeU5kmTSFUdx5G3QYdN3Wuo9LdDake1T5pb7ui12Em5Bq", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[4000].HistorySegmentID, "QmQ7ezyBxdQJDRoHgz4ZyFw5iDhzQY5E9hegZrtJocZtXX", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[5000].HistorySegmentID, "Qmf9KNqAg4XHs8vMozBeCsDLLG1v6MDzKLebonuhK7ksaq", snapshots)
}, postgresRuntimePath, sqlFs)

if exitCode != 0 {
Expand Down
18 changes: 10 additions & 8 deletions datanode/sqlstore/markets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,11 @@ func getTestMarket() *vega.Market {
func getTestFutureMarketWithLiquidationStrategy(termInt bool) *vega.Market {
mkt := getTestFutureMarket(termInt)
mkt.LiquidationStrategy = &vega.LiquidationStrategy{
DisposalTimeStep: 10,
DisposalFraction: "0.1",
FullDisposalSize: 20,
MaxFractionConsumed: "0.01",
DisposalTimeStep: 10,
DisposalFraction: "0.1",
FullDisposalSize: 20,
MaxFractionConsumed: "0.01",
DisposalSlippageRange: "0.1",
}
return mkt
}
Expand Down Expand Up @@ -1519,10 +1520,11 @@ func setupSuccessorMarkets(t *testing.T, ctx context.Context) (*sqlstore.Markets
ts := sqlstore.NewParties(connectionSource)

emptyLS := &vega.LiquidationStrategy{
DisposalTimeStep: 0,
DisposalFraction: "0",
FullDisposalSize: 0,
MaxFractionConsumed: "0",
DisposalTimeStep: 0,
DisposalFraction: "0",
FullDisposalSize: 0,
MaxFractionConsumed: "0",
DisposalSlippageRange: "0",
}
liquidationStrat := entities.LiquidationStrategyFromProto(emptyLS)
parentMarket := entities.Market{
Expand Down

0 comments on commit fcdbccf

Please sign in to comment.