Skip to content

Commit

Permalink
update fixture files
Browse files Browse the repository at this point in the history
  • Loading branch information
barnjamin committed Oct 16, 2023
1 parent 91a5233 commit 603f802
Show file tree
Hide file tree
Showing 30 changed files with 227 additions and 216 deletions.
15 changes: 7 additions & 8 deletions connect/src/protocols/cctpTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
TransferState,
WormholeTransfer,
} from "../wormholeTransfer";
import { retry } from "../tasks";
import { signSendWait } from "../common";
import { DEFAULT_TASK_TIMEOUT } from "../config";

Expand All @@ -45,7 +44,7 @@ export class CCTPTransfer implements WormholeTransfer {
transfer: CCTPTransferDetails;

// Populated after Initialized
txids?: TransactionId[];
txids: TransactionId[] = [];

// Populated if !automatic and after initialized
circleAttestations?: {
Expand Down Expand Up @@ -275,7 +274,7 @@ export class CCTPTransfer implements WormholeTransfer {
this.txids = await signSendWait(fromChain, xfer, signer);
this.state = TransferState.Initiated;

return this.txids!.map(({ txid }) => txid);
return this.txids.map(({ txid }) => txid);
}

private async _fetchWormholeAttestation(
Expand Down Expand Up @@ -306,7 +305,7 @@ export class CCTPTransfer implements WormholeTransfer {
if (!this.circleAttestations || this.circleAttestations.length == 0) {
// If we dont have any circle attestations yet, we need to start by
// fetching the transaction details from the source chain
if (!this.txids)
if (this.txids.length === 0)
throw new Error("No circle attestations or transactions to fetch");

// The last tx should be the circle transfer, its possible there was
Expand All @@ -319,14 +318,14 @@ export class CCTPTransfer implements WormholeTransfer {
this.circleAttestations = [{ id: circleMessage.messageId }];
}

// TODO: add conf for interval per service ?
const retryInterval = 5000;
for (const idx in this.circleAttestations) {
const ca = this.circleAttestations[idx];
if (ca.attestation) continue; // already got it

const task = () => this.wh.getCircleAttestation(ca.id.hash);
const attestation = await retry<string>(task, retryInterval, timeout);
const attestation = await this.wh.getCircleAttestation(
ca.id.hash,
timeout,
);
if (attestation === null)
throw new Error("No attestation available after timeout exhausted");

Expand Down
10 changes: 3 additions & 7 deletions platforms/cosmwasm/__tests__/unit/platform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ const COSMWASM_CHAINS = chains.filter((c) => c === "Cosmoshub");
describe("Cosmwasm Platform Tests", () => {
describe("Get Chain", () => {
test("No conf", () => {
// no issues just grabbing the chain
const p = CosmwasmPlatform.setConfig(network, {});
expect(p.conf).toEqual({});
const c = p.getChain(COSMWASM_CHAINS[0]);
expect(c).toBeTruthy();
expect(() => p.getChain(COSMWASM_CHAINS[0])).toThrow();
});

test("With conf", () => {
Expand All @@ -41,9 +39,7 @@ describe("Cosmwasm Platform Tests", () => {
// expect getRpc to throw an error since we havent provided
// the conf to figure out how to connect
expect(async () => await p.getRpc(COSMWASM_CHAINS[0])).rejects.toThrow();
expect(
async () => await p.getChain(COSMWASM_CHAINS[0]).getRpc()
).rejects.toThrow();
expect(async () => p.getChain(COSMWASM_CHAINS[0])).rejects.toThrow();
});

test("With conf", async () => {
Expand All @@ -52,7 +48,7 @@ describe("Cosmwasm Platform Tests", () => {
});
expect(async () => await p.getRpc(COSMWASM_CHAINS[0])).not.toThrow();
expect(
async () => await p.getChain(COSMWASM_CHAINS[0]).getRpc()
async () => await p.getChain(COSMWASM_CHAINS[0]).getRpc(),
).not.toThrow();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
},
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:28 GMT",
"Mon, 16 Oct 2023 13:45:03 GMT",
"Content-Type",
"application/json",
"Content-Length",
"39",
"Connection",
"close",
"CF-Cache-Status",
"DYNAMIC",
"HIT",
"Access-Control-Allow-Origin",
"*",
"Cache-Control",
Expand All @@ -37,12 +37,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80273ff52d350f63-EWR"
"8170bd73a8b442cd-EWR"
],
"responseIsBinary": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
],
"status": 200,
"response": [
"1f8b0800000000000003000000ffff",
"8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23231d3512a4a2d2ecd2951b25232a83054aad5c1a1d01445a1018540a93616000000ffff03003a214b0c92000000"
"1f8b0800000000000003000000ffff8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23231d5512a4a2d2ecd2951b25232a830a01028d5eae0b0c70cc51e43a5da5800000000ffff03003ab5307292000000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:30 GMT",
"Mon, 16 Oct 2023 13:45:06 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -49,12 +48,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80274005edf042d7-EWR",
"8170bd859b9f8c59-EWR",
"Content-Encoding",
"gzip"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"params": [
{
"to": "0x3ee18b2214aff97000d974cf647e7c347e8fa585",
"data": "0x1ff1e286000000000000000000000000000000000000000000000000000000000000000200000000000000000000000020baa02ba4e9665484e80b7f0da2b154b3af3f32"
"data": "0x1ff1e28600000000000000000000000000000000000000000000000000000000000000020000000000000000000000004bc6a1baadb9ab4d56650aefcf00e723b5f69d8a"
},
"latest"
],
Expand All @@ -23,12 +23,11 @@
],
"status": 200,
"response": [
"1f8b0800000000000003000000ffff",
"8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23231d1512a4a2d2ecd2951b25232a83054aad5c1a1d01845a1018540a93616000000ffff0300ecda684a92000000"
"1f8b08000000000000038aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23231d1512a4a2d2ecd2951b25232a83054aad5c1a1d01845a1018540a93616000000ffff0300ecda684a92000000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:30 GMT",
"Mon, 16 Oct 2023 13:45:06 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -49,12 +48,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80274004e92c43ef-EWR",
"8170bd8458aa41f2-EWR",
"Content-Encoding",
"gzip"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
"status": 200,
"response": [
"1f8b0800000000000003000000ffff",
"8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23234d0512a4a2d2ecd2951b25232a83054aad5c1a1d088588526442ab44451674021c0ed1e433ad9634c4d7b0c956a6301000000ffff03008d25333eb3010000"
"8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b2b2d4512a4a2d2ecd2951b25232a830a01028d5ea60b7c6d000c51e43dc0a0de9e42023621d644c4d07e1b1c704dd41b100000000ffff030082bb9a1cb3010000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:28 GMT",
"Mon, 16 Oct 2023 13:45:04 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -81,12 +81,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80273ff97c7643f2-EWR",
"8170bd7849fcc359-EWR",
"Content-Encoding",
"gzip"
],
Expand Down Expand Up @@ -132,12 +134,12 @@
],
"status": 200,
"response": [
"1f8b0800000000000003a4cd4b0a84301045d1bdbc7190943155215b1107494cc0a651f10342e3de7bec4010bce303b7fde1b34ee3322778d49586c2d0c3132b2c79ddbf1b3cf44138d50d744fa1bd40fd2ebeffc8a34f345498433089b2386bd814edc4068ad2e45aa2b3a5674e82b3fb030000ffff",
"03001516090123010000"
"1f8b0800000000000003000000ffff",
"a4cd4b0a84301045d1bdbc7190943155215b1107494cc0a651f10342e3de7bec4010bce303b7fde1b34ee3322778d49586c2d0c3132b2c79ddbf1b3cf44138d50d744fa1bd40fd2ebeffc8a34f345498433089b2386bd814edc4068ad2e45aa2b3a5674e82b3fb030000ffff03001516090123010000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:29 GMT",
"Mon, 16 Oct 2023 13:45:04 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -158,12 +160,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80273ffacdcf43a3-EWR",
"8170bd795ed618b4-EWR",
"Content-Encoding",
"gzip"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
],
"status": 200,
"response": [
"1f8b0800000000000003000000ffff8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23236d2512a4a2d2ecd2951b25232a83054aad5c1a1d01845a1018500b73d26c43ac8949a0ec2638f19b10e32a47208c502000000ffff",
"0300fb0fee9ab4010000"
"1f8b0800000000000003000000ffff",
"8aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23236d2512a4a2d2ecd2951b25232a83054aad5c1a1d0845885a6280a0d280378ec3123d64186d47490016e7b8ca96c4f2c000000ffff0300972007f5b4010000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:30 GMT",
"Mon, 16 Oct 2023 13:45:05 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -81,12 +81,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"802740016a1f428f-EWR",
"8170bd80cd5b0f47-EWR",
"Content-Encoding",
"gzip"
],
Expand Down Expand Up @@ -132,20 +134,21 @@
],
"status": 200,
"response": [
"1f8b08000000000000038aae56ca2acecf2b2a4856b25232d23350d251ca4c51b23236d7512a4a2d2ecd2951b25232a830a00c9829d5eae0b0c702c51e43dc0a2d89725092b1619a995962a271b261aab985a9b199719a8185b969a26192b949aa91799285695a8a9959b2394e7b4c0cd01d140b000000ffff",
"0300e7c2440823010000"
"1f8b0800000000000003000000ffff",
"a4cd410a83301046e1bbfceb2013c7cca4b98a7491c4045ac416ad5028debd6bc182d0b7fee0f51fdc97c7343f3302da8660701b10d81bcc6559c71702e86db19963d8d149c8ba83f45ff2fb7339f5496cab488c9c6d51ef58b89257176dd2aeb49abcab8348566cd72f000000ffff",
"0300e35eb38023010000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:30 GMT",
"Mon, 16 Oct 2023 13:45:05 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
"chunked",
"Connection",
"close",
"CF-Cache-Status",
"HIT",
"DYNAMIC",
"Access-Control-Allow-Origin",
"*",
"Cache-Control",
Expand All @@ -158,12 +161,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80274002b98d4219-EWR",
"8170bd822ad14265-EWR",
"Content-Encoding",
"gzip"
],
Expand Down Expand Up @@ -193,20 +198,19 @@
],
"status": 200,
"response": [
"1f8b0800000000000003000000ffff",
"74ca4d0e40301006d0bb7ceb46a6d5327a15b140671222889f4422ee6e6de1ad5f7d63dc97795b7b44b88c60302444ef0c36d9cfe940045d168ff989f613e90707b539772ae245598227aea8d7ceb3168e426953514a6a733ccd0b0000ffff03008c7aaf0592000000"
"1f8b080000000000000374cd4d0e40301006d0bb7ceb46a6d5327a15b140671222889f4422ee6e6de15de0d537c67d99b7b54784cb08064342f4d66093fd9c0e44d0453f38a8cdb953112fca123c7145bd769eb570144a9b8a52529be3313f8ffb3c164ff3020000ffff03002fad529792000000"
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:30 GMT",
"Mon, 16 Oct 2023 13:45:05 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
"chunked",
"Connection",
"close",
"CF-Cache-Status",
"DYNAMIC",
"HIT",
"Access-Control-Allow-Origin",
"*",
"Cache-Control",
Expand All @@ -219,12 +223,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80274003bb6e4386-EWR",
"8170bd833d7e5e6d-EWR",
"Content-Encoding",
"gzip"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"rawHeaders": [
"Date",
"Wed, 06 Sep 2023 14:02:29 GMT",
"Mon, 16 Oct 2023 13:45:04 GMT",
"Content-Type",
"application/json",
"Transfer-Encoding",
Expand All @@ -49,12 +49,14 @@
"86400",
"x-multirpc-response-type",
"1",
"X-Robots-Tag",
"noindex, nofollow",
"Vary",
"Accept-Encoding",
"Server",
"cloudflare",
"CF-RAY",
"80273ffbfdeb43e8-EWR",
"8170bd7a7f8543c4-EWR",
"Content-Encoding",
"gzip"
],
Expand Down
Loading

0 comments on commit 603f802

Please sign in to comment.