Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Oct 23, 2024
1 parent 34449c3 commit d7b0755
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions Blockchain/Tests/BlockchainTests/ExtrinsicPoolServiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ struct ExtrinsicPoolServiceTests {

allTickets.append(contentsOf: tickets)

let event = RuntimeEvents.SafroleTicketsGenerated(items: tickets, publicKey: secretKey.publicKey)
let event = RuntimeEvents.SafroleTicketsGenerated(
epochIndex: state.value.timeslot.timeslotToEpochIndex(config: config),
items: tickets,
publicKey: secretKey.publicKey
)
await eventBus.publish(event)

// Wait for the event to be processed
Expand Down Expand Up @@ -126,7 +130,11 @@ struct ExtrinsicPoolServiceTests {
idx: 0
)

let addEvent = RuntimeEvents.SafroleTicketsGenerated(items: tickets, publicKey: secretKey.publicKey)
let addEvent = RuntimeEvents.SafroleTicketsGenerated(
epochIndex: state.value.timeslot.timeslotToEpochIndex(config: config),
items: tickets,
publicKey: secretKey.publicKey
)
await eventBus.publish(addEvent)

// Wait for the event to be processed
Expand Down Expand Up @@ -173,7 +181,11 @@ struct ExtrinsicPoolServiceTests {
idx: 0
)

let addEvent = RuntimeEvents.SafroleTicketsGenerated(items: oldTickets, publicKey: secretKey.publicKey)
let addEvent = RuntimeEvents.SafroleTicketsGenerated(
epochIndex: state.value.timeslot.timeslotToEpochIndex(config: config),
items: oldTickets,
publicKey: secretKey.publicKey
)
await eventBus.publish(addEvent)
await storeMiddleware.wait()

Expand Down Expand Up @@ -216,7 +228,11 @@ struct ExtrinsicPoolServiceTests {
)

// Ensure new tickets are accepted
let newAddEvent = RuntimeEvents.SafroleTicketsGenerated(items: newTickets, publicKey: secretKey.publicKey)
let newAddEvent = RuntimeEvents.SafroleTicketsGenerated(
epochIndex: newState.value.timeslot.timeslotToEpochIndex(config: config),
items: newTickets,
publicKey: secretKey.publicKey
)
await eventBus.publish(newAddEvent)
await storeMiddleware.wait()

Expand Down

0 comments on commit d7b0755

Please sign in to comment.