Skip to content

Commit

Permalink
Fix lbp pool active validation
Browse files Browse the repository at this point in the history
  • Loading branch information
nohaapav committed Jan 2, 2024
1 parent d5721b5 commit b9509f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/sdk/src/pool/lbp/LbpPoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class LbpPoolClient extends PoolClient {
private poolsData: Map<string, PalletLbpPool> = new Map([]);

isSupported(): boolean {
return this.api.query.xyk !== undefined;
return this.api.query.lbp !== undefined;
}

async loadPools(): Promise<PoolBase[]> {
Expand Down Expand Up @@ -161,6 +161,10 @@ export class LbpPoolClient extends PoolClient {
poolEntry: PalletLbpPool,
relayBlockNumber: u32
): boolean {
if (poolEntry.start.isEmpty || poolEntry.end.isEmpty) {
return false;
}

const start = poolEntry.start.unwrap().toNumber();
const end = poolEntry.end.unwrap().toNumber();
return (
Expand Down

0 comments on commit b9509f2

Please sign in to comment.