Skip to content

Commit

Permalink
Allow Close to be sent after any message kind
Browse files Browse the repository at this point in the history
  • Loading branch information
diehuxx committed Mar 6, 2024
1 parent 67d58b9 commit c09e319
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/http-server/src/http-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class TbdexHttpServer {
api.use(jsonBodyParser())

this.api = api

}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/src/message-kinds/order-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type CreateOrderStatusOptions = {
*/
export class OrderStatus extends Message {
/** a set of valid Message kinds that can come after an order status */
readonly validNext = new Set<MessageKind>(['orderstatus'])
readonly validNext = new Set<MessageKind>(['orderstatus', 'close'])
/** The message kind (orderstatus) */
readonly kind = 'orderstatus'

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/src/message-kinds/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type CreateOrderOptions = {
*/
export class Order extends Message {
/** a set of valid Message kinds that can come after an order */
readonly validNext = new Set<MessageKind>(['orderstatus'])
readonly validNext = new Set<MessageKind>(['orderstatus', 'close'])
/** The message kind (order) */
readonly kind = 'order'

Expand Down

0 comments on commit c09e319

Please sign in to comment.