Skip to content

Commit

Permalink
feat: integration tests and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDeco committed May 1, 2024
1 parent 1dc53fd commit 818d7e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/futarchy-sdk",
"version": "1.1.0-alpha.1",
"version": "1.1.0-alpha.3",
"main": "dist",
"scripts": {
"build": "tsc --project tsconfig.build.json && tscpaths -p tsconfig.json -s ./lib -o ./dist",
Expand Down
17 changes: 16 additions & 1 deletion tests/client/rpc/markets.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("FutarchyRPCClient Integration Test", () => {
console.log(marketData); // Log to verify data or perform assertions
expect(marketData).toBeDefined(); // Simple check, adjust according to expected data structure
}, 60000);
test("fetchMarket should return market data for amm market", async () => {
test.skip("fetchMarket should return market data for amm market", async () => {
const { programId, idl } = autocratVersionToTwapMap["V0.3"];
const openbookTwap = new Program(idl, programId, provider);
const request = new OpenbookMarketFetchRequest(
Expand All @@ -51,6 +51,21 @@ describe("FutarchyRPCClient Integration Test", () => {
console.log(marketData); // Log to verify data or perform assertions
expect(marketData).toBeDefined(); // Simple check, adjust according to expected data structure
}, 60000);
test.skip("addLiquidity test. This should likely not run in CI for now", async () => {
const request = new AmmMarketFetchRequest(
new PublicKey("HbSYiZ8JRKqNHTx2EJUr6c5wQMvMjNx1rmHkTUtVi9qC")
);
const marketData = await rpcClient.markets.fetchMarket(request);
if (marketData?.type === "amm") {
const txs = await rpcClient.markets.amm.addLiquidity(
marketData,
0.1,
0.1
);
console.log(txs); // Log to verify data or perform assertions
expect(txs).toBeDefined(); // Simple check, adjust according to expected data structure
}
}, 60000);

// Add more tests for other methods like cancelOrder, fetchOrderBook, etc.
});

0 comments on commit 818d7e2

Please sign in to comment.