Skip to content

Commit

Permalink
add ability to get state
Browse files Browse the repository at this point in the history
  • Loading branch information
icezohu committed May 23, 2024
1 parent 20748a0 commit be6a33a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/network-support/src/orderManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ export class OrderManager {
}
}

async getSignedState(channelId: string, block: BlockType): Promise<State> {
return this.stateManager.getSignedState(channelId, block);
}

async syncChannelState(channelId: string, state: State | ChannelState): Promise<void> {
await this.stateManager.syncState(channelId, state);
}
Expand All @@ -314,8 +318,9 @@ export class OrderManager {

if (!this.agreements) return;

this.logger?.debug(`available agreements: ${this.agreements.length}`);
const agreements = await this.filterOrdersByRequestId(requestId, this.agreements);
this.logger?.debug(`available agreements count: ${agreements.length}`);
this.logger?.debug(`available agreements after filter: ${agreements.length}`);

if (!this.healthy || !agreements.length) return;

Expand All @@ -335,8 +340,9 @@ export class OrderManager {

if (!this.plans) return;

this.logger?.debug(`available plans: ${this.plans.length}`);
const plans = await this.filterOrdersByRequestId(requestId, this.plans);
this.logger?.debug(`available plans count: ${plans.length}`);
this.logger?.debug(`available plans after filter: ${plans.length}`);

if (!this.healthy || !plans?.length) return;

Expand Down

0 comments on commit be6a33a

Please sign in to comment.