Files
Cezary Haliniarz 25c1a92da2 feat: add oracle registry and manifest fallback (#103)
* feat: add oracle registry and manifest fallback

* feat: adjust to new promise-timeout version

* chore: refactor fetching oracle registry state
2022-07-08 16:12:13 +02:00

47 lines
1.1 KiB
TypeScript

import { Manifest } from "../../../src/types";
const validSmartweaveMock = {
smartweave: {
contract: (_contractId: string) => ({
readState: () => Promise.resolve({
state: {
nodes: {
mockArAddress: {
dataFeedId: "testDataFeedId"
}
},
dataFeeds: {
testDataFeedId: {
manifestTxId: "manifestTxIdByGateway"
}
}
}
})
})
}
};
const invalidSmartweaveMock = {
smartweave: {
contract: (_contractId: string) => ({
readState: () => Promise.reject()
})
}
};
export const validMockArProxy = {
getAddress: () => Promise.resolve("mockArAddress"),
...validSmartweaveMock,
};
export const invalidMockArProxy = {
getAddress: () => Promise.resolve("mockArAddress"),
...invalidSmartweaveMock,
};
export const oldManifestMock = { txId: "oldManifestTxId" } as Manifest;
export const manifestUsingDenMock = { txId: "manifestTxIdByDen", interval: 1000 };
export const manifestUsingGatewayMock = { txId: "manifestTxIdByGateway", interval: 1000 };