Преглед изворни кода

[wormhole-attester] Remove wasm in js sdk (#537)

* [wormhole-attester] Remove wasm in js sdk

* Cleanup dependencies and unused codes

* Cleanup rust

* Add tests + minor improvements

* Add ignored price status

* Revert cargo lock
Ali Behjati пре 2 година
родитељ
комит
f9e0145352

+ 3 - 15
Tiltfile

@@ -62,18 +62,6 @@ if not ci:
 def k8s_yaml_with_ns(objects):
     return k8s_yaml(namespace_inject(objects, namespace))
 
-# wasm
-
-local_resource(
-    name = "wasm-gen",
-    cmd = "tilt docker build -- -f tilt_devnet/docker_images/Dockerfile.wasm -o type=local,dest=. .",
-    env = {"DOCKER_BUILDKIT": "1"},
-    deps = "./wormhole_attester",
-    labels = ["wasm"],
-    allow_parallel=True,
-    trigger_mode = trigger_mode,
-)
-
 def build_node_yaml():
     node_yaml = read_yaml_stream("tilt_devnet/k8s/node.yaml")
 
@@ -220,7 +208,7 @@ docker_build(
 k8s_yaml_with_ns("tilt_devnet/k8s/p2w-terra-relay.yaml")
 k8s_resource(
     "p2w-terra-relay",
-    resource_deps = ["pyth", "p2w-attest", "spy", "terra-terrad", "wasm-gen"],
+    resource_deps = ["pyth", "p2w-attest", "spy", "terra-terrad"],
     port_forwards = [
         port_forward(4200, name = "Rest API (Status + Query) [:4200]", host = webHost),
         port_forward(8081, name = "Prometheus [:8081]", host = webHost)],
@@ -230,7 +218,7 @@ k8s_resource(
 k8s_yaml_with_ns("tilt_devnet/k8s/p2w-evm-relay.yaml")
 k8s_resource(
     "p2w-evm-relay",
-    resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet", "wasm-gen"],
+    resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet"],
     port_forwards = [
         port_forward(4201, container_port = 4200, name = "Rest API (Status + Query) [:4201]", host = webHost),
         port_forward(8082, container_port = 8081, name = "Prometheus [:8082]", host = webHost)],
@@ -246,7 +234,7 @@ docker_build(
 k8s_yaml_with_ns("tilt_devnet/k8s/pyth-price-server.yaml")
 k8s_resource(
     "pyth-price-server",
-    resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet", "wasm-gen"],
+    resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet"],
     port_forwards = [
         port_forward(4202, container_port = 4200, name = "Rest API (Status + Query) [:4202]", host = webHost),
         port_forward(8083, container_port = 8081, name = "Prometheus [:8083]", host = webHost)],

+ 0 - 39
tilt_devnet/docker_images/Dockerfile.wasm

@@ -1,39 +0,0 @@
-# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
-FROM docker.io/library/rust:1.49@sha256:a50165ea96983c21832578afb1c8c028674c965bc1ed43b607871b1f362e06a5 AS build
-
-RUN apt-get update && \
-  apt-get install -y libssl-dev libudev-dev pkg-config zlib1g-dev llvm clang && \
-  apt-get clean && rm -rf /var/lib/apt/lists/*
-
-# We default an older nightly since current rust-toolchain makes the
-# wasm-pack build unhappy, we introduce it later for our code
-RUN rustup component add rustfmt && \
-  rustup default nightly-2022-01-02
-
-WORKDIR /usr/src
-RUN cargo install wasm-pack --vers 0.9.1
-ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=trace,solana_bpf_loader=debug,solana_rbpf=debug"
-ENV EMITTER_ADDRESS="11111111111111111111111111111115"
-ENV BRIDGE_ADDRESS="Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o"
-
-COPY wormhole_attester wormhole_attester
-COPY governance/remote_executor governance/remote_executor
-
-# wasm-bindgen 0.2.74 generates JavaScript bindings for SystemInstruction exported from solana-program 1.9.4.
-# The generated JavaScript references a non-existent function (wasm.__wbg_systeminstruction_free) that leads
-# to an attempted import error when importing the wasm packed for bundler. SystemInstruction isn't used in the sdk,
-# so we remove the non-existent function reference as a workaround.
-ARG SED_REMOVE_INVALID_REFERENCE="/^\s*wasm.__wbg_systeminstruction_free(ptr);$/d"
-
-# TODO: it appears that wasm-pack ignores our lockfiles even with --locked
-
-# Run unit tests
-WORKDIR /usr/src/wormhole_attester/sdk/rust
-RUN cargo test --locked && \
-  /usr/local/cargo/bin/wasm-pack build --target bundler -d bundler -- --features wasm --locked && \
-  /usr/local/cargo/bin/wasm-pack build --target nodejs -d nodejs -- --features wasm --locked
-
-FROM scratch AS export
-
-COPY --from=build /usr/src/wormhole_attester/sdk/rust/bundler wormhole_attester/sdk/js/src/wasm/bundler
-COPY --from=build /usr/src/wormhole_attester/sdk/rust/nodejs wormhole_attester/sdk/js/src/wasm/nodejs

+ 0 - 3
wormhole_attester/Cargo.lock

@@ -2751,7 +2751,6 @@ dependencies = [
  "serde",
  "solana-program",
  "solitaire",
- "wasm-bindgen",
 ]
 
 [[package]]
@@ -5177,8 +5176,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad"
 dependencies = [
  "cfg-if",
- "serde",
- "serde_json",
  "wasm-bindgen-macro",
 ]
 

+ 0 - 23
wormhole_attester/sdk/js/Dockerfile

@@ -1,23 +0,0 @@
-FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20
-
-# Build ETH
-WORKDIR /usr/src/ethereum
-COPY ethereum/package.json ethereum/package-lock.json ./
-RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
-    npm ci
-COPY ethereum .
-
-# Build Wormhole SDK
-WORKDIR /usr/src/sdk/js
-COPY sdk/js/package.json sdk/js/package-lock.json ./
-RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
-    npm ci
-COPY sdk/js .
-
-# Build wormhole sdk attester in dir preserving directory structure
-WORKDIR /usr/src/wormhole_attester/sdk/js/
-COPY wormhole_attester/sdk/js/package.json wormhole_attester/sdk/js/package-lock.json ./
-RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
-    npm ci
-COPY wormhole_attester/sdk .
-RUN npm run build-test

+ 5 - 0
wormhole_attester/sdk/js/jest.config.js

@@ -0,0 +1,5 @@
+/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
+module.exports = {
+  preset: "ts-jest",
+  testEnvironment: "node",
+};

Разлика између датотеке није приказан због своје велике величине
+ 7428 - 3246
wormhole_attester/sdk/js/package-lock.json


+ 7 - 13
wormhole_attester/sdk/js/package.json

@@ -1,19 +1,17 @@
 {
   "name": "@pythnetwork/wormhole-attester-sdk",
   "version": "1.0.0",
-  "description": "TypeScript library for interacting with Pyth2Wormhole",
+  "description": "Pyth Wormhole Attester SDk",
   "types": "lib/index.d.ts",
   "main": "lib/index.js",
   "files": [
     "lib/**/*"
   ],
   "scripts": {
-    "build": "npm run build-lib",
-    "build-lib": "npm run copy-artifacts && tsc",
-    "build-watch": "npm run copy-artifacts && tsc --watch",
+    "build": "tsc",
     "format": "prettier --write \"src/**/*.ts\"",
-    "copy-artifacts": "node scripts/copyWasm.cjs",
     "lint": "tslint -p tsconfig.json",
+    "test": "jest src/",
     "postversion": "git push && git push --tags",
     "preversion": "npm run lint",
     "version": "npm run format && git add -A src"
@@ -22,26 +20,22 @@
     "type": "git",
     "url": "git+https://github.com/pyth-network/pyth-crosschain.git"
   },
-  "author": "https://certus.one",
+  "author": "Pyth Data Association",
   "license": "MIT",
   "devDependencies": {
-    "@openzeppelin/contracts": "^4.2.0",
-    "@typechain/ethers-v5": "^7.1.2",
+    "@types/jest": "^29.4.0",
     "@types/long": "^4.0.1",
     "@types/node": "^16.6.1",
     "copy-dir": "^1.3.0",
     "find": "^0.3.0",
+    "jest": "^29.4.1",
     "prettier": "^2.3.2",
+    "ts-jest": "^29.0.5",
     "tslint": "^6.1.3",
     "tslint-config-prettier": "^1.18.0",
     "typescript": "^4.3.5"
   },
-  "peerDependencies": {
-    "@solana/web3.js": "^1.24.0"
-  },
   "dependencies": {
-    "@certusone/wormhole-sdk": "0.2.1",
-    "@improbable-eng/grpc-web-node-http-transport": "^0.14.1",
     "@pythnetwork/pyth-sdk-js": "^1.1.0"
   },
   "bugs": {

+ 0 - 16
wormhole_attester/sdk/js/scripts/copyWasm.cjs

@@ -1,16 +0,0 @@
-const find = require("find");
-const fs = require("fs");
-const path = require("path");
-
-const SOURCE_ROOT = "src";
-const TARGET_ROOT = "lib";
-
-find.eachfile(/\.wasm(\..*)?/, SOURCE_ROOT, (fname) => {
-  fname_copy = fname.replace(SOURCE_ROOT, TARGET_ROOT);
-
-  console.log("copyWasm:", fname, "to", fname_copy);
-
-  fs.mkdirSync(path.dirname(fname_copy), { recursive: true });
-
-  fs.copyFileSync(fname, fname_copy);
-});

+ 133 - 0
wormhole_attester/sdk/js/src/__tests__/index.test.ts

@@ -0,0 +1,133 @@
+import {
+  parseBatchPriceAttestation,
+  Price,
+  PriceFeed,
+  PriceAttestation,
+  PriceAttestationStatus,
+  priceAttestationToPriceFeed,
+} from "../index";
+
+describe("Deserializing Batch Price Attestation works", () => {
+  test("when batch has 3 price feeds", () => {
+    // Generated from the rust sdk test_batch_serde
+    const fixture =
+      "50325748000300010001020003009D01010101010101010101010101010101010101010101010101010" +
+      "10101010101FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE0000002B" +
+      "AD2FEED70000000000000065FFFFFFFDFFFFFFFFFFFFFFD6000000000000002A010001E14C0004E6D00" +
+      "000DEADBEEFFADE00000000DADEBEEF00000000DEADBABE0000DEADFACEBEEF000000BADBADBEEFDEAD" +
+      "BEEFFADEDEAF0202020202020202020202020202020202020202020202020202020202020202FDFDFDF" +
+      "DFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFDFD0000002BAD2FEED70000000000" +
+      "000065FFFFFFFDFFFFFFFFFFFFFFD6000000000000002A010001E14C0004E6D00000DEADBEEFFADE000" +
+      "00000DADEBEEF00000000DEADBABE0000DEADFACEBEEF000000BADBADBEEFDEADBEEFFADEDEAF030303" +
+      "0303030303030303030303030303030303030303030303030303030303FCFCFCFCFCFCFCFCFCFCFCFCF" +
+      "CFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC0000002BAD2FEED70000000000000065FFFFFFFDFFFF" +
+      "FFFFFFFFFFD6000000000000002A010001E14C0004E6D00000DEADBEEFFADE00000000DADEBEEF00000" +
+      "000DEADBABE0000DEADFACEBEEF000000BADBADBEEFDEADBEEFFADEDEAF";
+
+    const data = Buffer.from(fixture, "hex");
+    const batchPriceAttestation = parseBatchPriceAttestation(data);
+
+    expect(batchPriceAttestation.priceAttestations.length).toBe(3);
+
+    // values are from the rust sdk mock_attestation
+    batchPriceAttestation.priceAttestations.forEach((pa, idx) => {
+      expect(pa).toEqual<PriceAttestation>({
+        productId: Buffer.from(Array(32).fill(idx + 1)).toString("hex"),
+        priceId: Buffer.from(Array(32).fill(255 - idx - 1)).toString("hex"),
+        price: (0x2bad2feed7).toString(),
+        conf: "101",
+        emaPrice: "-42",
+        emaConf: "42",
+        expo: -3,
+        status: PriceAttestationStatus.Trading,
+        numPublishers: 123212,
+        maxNumPublishers: 321232,
+        attestationTime: 0xdeadbeeffade,
+        publishTime: 0xdadebeef,
+        prevPublishTime: 0xdeadbabe,
+        prevPrice: (0xdeadfacebeef).toString(),
+        prevConf: (0xbadbadbeef).toString(),
+      });
+    });
+  });
+});
+
+describe("Price Attestation to Price Feed works", () => {
+  test("when status is trading", () => {
+    const priceAttestation = {
+      productId: "012345",
+      priceId: "abcde",
+      price: "100",
+      conf: "5",
+      emaPrice: "103",
+      emaConf: "3",
+      expo: -3,
+      status: PriceAttestationStatus.Trading,
+      numPublishers: 1,
+      maxNumPublishers: 2,
+      attestationTime: 1000,
+      publishTime: 1000,
+      prevPublishTime: 998,
+      prevPrice: "101",
+      prevConf: "6",
+    };
+
+    const priceFeed = priceAttestationToPriceFeed(priceAttestation);
+    expect(priceFeed).toEqual(
+      new PriceFeed({
+        id: "abcde",
+        price: new Price({
+          price: "100",
+          conf: "5",
+          expo: -3,
+          publishTime: 1000,
+        }),
+        emaPrice: new Price({
+          price: "103",
+          conf: "3",
+          expo: -3,
+          publishTime: 1000,
+        }),
+      })
+    );
+  });
+
+  test("when status is not trading", () => {
+    const priceAttestation = {
+      productId: "012345",
+      priceId: "abcde",
+      price: "100",
+      conf: "5",
+      emaPrice: "103",
+      emaConf: "3",
+      expo: -3,
+      status: PriceAttestationStatus.Unknown,
+      numPublishers: 1,
+      maxNumPublishers: 2,
+      attestationTime: 1000,
+      publishTime: 1000,
+      prevPublishTime: 998,
+      prevPrice: "101",
+      prevConf: "6",
+    };
+
+    const priceFeed = priceAttestationToPriceFeed(priceAttestation);
+    expect(priceFeed).toEqual(
+      new PriceFeed({
+        id: "abcde",
+        price: new Price({
+          price: "101",
+          conf: "6",
+          expo: -3,
+          publishTime: 998,
+        }),
+        emaPrice: new Price({
+          price: "103",
+          conf: "3",
+          expo: -3,
+          publishTime: 998,
+        }),
+      })
+    );
+  });
+});

+ 149 - 48
wormhole_attester/sdk/js/src/index.ts

@@ -1,19 +1,12 @@
-import { getSignedVAA, CHAIN_ID_SOLANA } from "@certusone/wormhole-sdk";
-import { zeroPad } from "ethers/lib/utils";
-import { PublicKey } from "@solana/web3.js";
 import { PriceFeed, Price, UnixTimestamp } from "@pythnetwork/pyth-sdk-js";
-
-let _P2W_WASM: any;
-
-async function importWasm() {
-  if (!_P2W_WASM) {
-    if (typeof window === "undefined") {
-      _P2W_WASM = await import("./wasm/nodejs/pyth_wormhole_attester_sdk");
-    } else {
-      _P2W_WASM = await import("./wasm/bundler/pyth_wormhole_attester_sdk");
-    }
-  }
-  return _P2W_WASM;
+export { PriceFeed, Price, UnixTimestamp } from "@pythnetwork/pyth-sdk-js";
+
+export enum PriceAttestationStatus {
+  Unknown = 0,
+  Trading = 1,
+  Halted = 2,
+  Auction = 3,
+  IGNORED = 4,
 }
 
 export type PriceAttestation = {
@@ -24,7 +17,7 @@ export type PriceAttestation = {
   expo: number;
   emaPrice: string;
   emaConf: string;
-  status: number;
+  status: PriceAttestationStatus;
   numPublishers: number;
   maxNumPublishers: number;
   attestationTime: UnixTimestamp;
@@ -38,13 +31,146 @@ export type BatchPriceAttestation = {
   priceAttestations: PriceAttestation[];
 };
 
-export async function parseBatchPriceAttestation(
-  arr: Buffer
-): Promise<BatchPriceAttestation> {
-  const wasm = await importWasm();
-  const rawVal = await wasm.parse_batch_attestation(arr);
+/// Precedes every message implementing the wormhole attester serialization format
+const P2W_FORMAT_MAGIC: string = "P2WH";
+const P2W_FORMAT_VER_MAJOR = 3;
+const P2W_FORMAT_VER_MINOR = 0;
+const P2W_FORMAT_PAYLOAD_ID = 2;
+
+export function parsePriceAttestation(bytes: Buffer): PriceAttestation {
+  let offset = 0;
+
+  const productId = bytes.slice(offset, offset + 32).toString("hex");
+  offset += 32;
+
+  const priceId = bytes.slice(offset, offset + 32).toString("hex");
+  offset += 32;
+
+  const price = bytes.readBigInt64BE(offset).toString();
+  offset += 8;
+
+  const conf = bytes.readBigUint64BE(offset).toString();
+  offset += 8;
+
+  const expo = bytes.readInt32BE(offset);
+  offset += 4;
+
+  const emaPrice = bytes.readBigInt64BE(offset).toString();
+  offset += 8;
+
+  const emaConf = bytes.readBigUint64BE(offset).toString();
+  offset += 8;
+
+  const status = bytes.readUint8(offset) as PriceAttestationStatus;
+  offset += 1;
+
+  const numPublishers = bytes.readUint32BE(offset);
+  offset += 4;
+
+  const maxNumPublishers = bytes.readUint32BE(offset);
+  offset += 4;
+
+  const attestationTime = Number(bytes.readBigInt64BE(offset));
+  offset += 8;
+
+  const publishTime = Number(bytes.readBigInt64BE(offset));
+  offset += 8;
+
+  const prevPublishTime = Number(bytes.readBigInt64BE(offset));
+  offset += 8;
+
+  const prevPrice = bytes.readBigInt64BE(offset).toString();
+  offset += 8;
+
+  const prevConf = bytes.readBigUint64BE(offset).toString();
+  offset += 8;
+
+  return {
+    productId,
+    priceId,
+    price,
+    conf,
+    expo,
+    emaPrice,
+    emaConf,
+    status,
+    numPublishers,
+    maxNumPublishers,
+    attestationTime,
+    publishTime,
+    prevPublishTime,
+    prevPrice,
+    prevConf,
+  };
+}
+
+// Read the sdk/rust as the reference implementation and documentation.
+export function parseBatchPriceAttestation(
+  bytes: Buffer
+): BatchPriceAttestation {
+  let offset = 0;
+
+  const magic = bytes.slice(offset, offset + 4).toString("utf8");
+  offset += 4;
+  if (magic !== P2W_FORMAT_MAGIC) {
+    throw new Error(`Invalid magic: ${magic}, expected: ${P2W_FORMAT_MAGIC}`);
+  }
+
+  const versionMajor = bytes.readUInt16BE(offset);
+  offset += 2;
+  if (versionMajor !== P2W_FORMAT_VER_MAJOR) {
+    throw new Error(
+      `Unsupported major version: ${versionMajor}, expected: ${P2W_FORMAT_VER_MAJOR}`
+    );
+  }
+
+  const versionMinor = bytes.readUInt16BE(offset);
+  offset += 2;
+  if (versionMinor < P2W_FORMAT_VER_MINOR) {
+    throw new Error(
+      `Unsupported minor version: ${versionMinor}, expected: ${P2W_FORMAT_VER_MINOR}`
+    );
+  }
+
+  // Header size is added for future-compatibility
+  const headerSize = bytes.readUint16BE(offset);
+  offset += 2;
+
+  let headerOffset = 0;
+
+  const payloadId = bytes.readUint8(offset + headerOffset);
+  headerOffset += 1;
+
+  if (payloadId !== P2W_FORMAT_PAYLOAD_ID) {
+    throw new Error(
+      `Invalid payloadId: ${payloadId}, expected: ${P2W_FORMAT_PAYLOAD_ID}`
+    );
+  }
+
+  offset += headerSize;
+
+  const batchLen = bytes.readUInt16BE(offset);
+  offset += 2;
+
+  const attestationSize = bytes.readUint16BE(offset);
+  offset += 2;
 
-  return rawVal;
+  let priceAttestations: PriceAttestation[] = [];
+
+  for (let i = 0; i < batchLen; i += 1) {
+    priceAttestations.push(
+      parsePriceAttestation(bytes.subarray(offset, offset + attestationSize))
+    );
+    offset += attestationSize;
+  }
+
+  if (offset !== bytes.length) {
+    throw new Error(`Invalid length: ${bytes.length}, expected: ${offset}`);
+  }
+
+  return {
+    priceAttestations,
+  };
 }
 
 // Returns a hash of all priceIds within the batch, it can be used to identify whether there is a
@@ -75,27 +201,6 @@ export function getBatchSummary(batch: BatchPriceAttestation): string {
   return JSON.stringify(abstractRepresentation);
 }
 
-export async function getSignedAttestation(
-  host: string,
-  p2wAddr: string,
-  sequence: number,
-  extraGrpcOpts = {}
-): Promise<any> {
-  const [emitter, _] = await PublicKey.findProgramAddress(
-    [Buffer.from("p2w-emitter")],
-    new PublicKey(p2wAddr)
-  );
-
-  const emitterHex = sol_addr2buf(emitter).toString("hex");
-  return await getSignedVAA(
-    host,
-    CHAIN_ID_SOLANA,
-    emitterHex,
-    "" + sequence,
-    extraGrpcOpts
-  );
-}
-
 export function priceAttestationToPriceFeed(
   priceAttestation: PriceAttestation
 ): PriceFeed {
@@ -108,7 +213,7 @@ export function priceAttestationToPriceFeed(
 
   let price: Price;
 
-  if (priceAttestation.status === 1) {
+  if (priceAttestation.status === PriceAttestationStatus.Trading) {
     // 1 means trading
     price = new Price({
       conf: priceAttestation.conf,
@@ -135,7 +240,3 @@ export function priceAttestationToPriceFeed(
     price,
   });
 }
-
-function sol_addr2buf(addr: PublicKey): Buffer {
-  return Buffer.from(zeroPad(addr.toBytes(), 32));
-}

+ 0 - 1298
wormhole_attester/sdk/rust/Cargo.lock

@@ -1,1298 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "ahash"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
-dependencies = [
- "getrandom 0.2.6",
- "once_cell",
- "version_check",
-]
-
-[[package]]
-name = "arrayref"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-
-[[package]]
-name = "autocfg"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
-
-[[package]]
-name = "base64"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
-
-[[package]]
-name = "base64"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
-
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitmaps"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
-dependencies = [
- "typenum",
-]
-
-[[package]]
-name = "blake3"
-version = "1.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f"
-dependencies = [
- "arrayref",
- "arrayvec",
- "cc",
- "cfg-if",
- "constant_time_eq",
- "digest 0.10.3",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
-dependencies = [
- "block-padding",
- "generic-array",
-]
-
-[[package]]
-name = "block-buffer"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "block-padding"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
-
-[[package]]
-name = "borsh"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa"
-dependencies = [
- "borsh-derive",
- "hashbrown",
-]
-
-[[package]]
-name = "borsh-derive"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775"
-dependencies = [
- "borsh-derive-internal",
- "borsh-schema-derive-internal",
- "proc-macro-crate",
- "proc-macro2",
- "syn",
-]
-
-[[package]]
-name = "borsh-derive-internal"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "borsh-schema-derive-internal"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "bs58"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
-
-[[package]]
-name = "bumpalo"
-version = "3.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
-
-[[package]]
-name = "bv"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340"
-dependencies = [
- "feature-probe",
- "serde",
-]
-
-[[package]]
-name = "bytemuck"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdead85bdec19c194affaeeb670c0e41fe23de31459efd1c174d049269cf02cc"
-dependencies = [
- "bytemuck_derive",
-]
-
-[[package]]
-name = "bytemuck_derive"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "562e382481975bc61d11275ac5e62a19abd00b0547d99516a415336f183dcd0e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "cc"
-version = "1.0.73"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "console_error_panic_hook"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
-dependencies = [
- "cfg-if",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "console_log"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494"
-dependencies = [
- "log",
- "web-sys",
-]
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "crunchy"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
-
-[[package]]
-name = "crypto-common"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8"
-dependencies = [
- "generic-array",
- "typenum",
-]
-
-[[package]]
-name = "crypto-mac"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
-dependencies = [
- "generic-array",
- "subtle",
-]
-
-[[package]]
-name = "curve25519-dalek"
-version = "3.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0"
-dependencies = [
- "byteorder",
- "digest 0.9.0",
- "rand_core 0.5.1",
- "subtle",
- "zeroize",
-]
-
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
-dependencies = [
- "block-buffer 0.10.2",
- "crypto-common",
- "subtle",
-]
-
-[[package]]
-name = "dyn-clone"
-version = "1.0.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28"
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "feature-probe"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da"
-
-[[package]]
-name = "generic-array"
-version = "0.14.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803"
-dependencies = [
- "serde",
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
-dependencies = [
- "cfg-if",
- "js-sys",
- "libc",
- "wasi 0.9.0+wasi-snapshot-preview1",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi 0.10.2+wasi-snapshot-preview1",
-]
-
-[[package]]
-name = "hashbrown"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
-dependencies = [
- "ahash",
-]
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hex"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "hmac"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
-dependencies = [
- "crypto-mac",
- "digest 0.9.0",
-]
-
-[[package]]
-name = "hmac-drbg"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
-dependencies = [
- "digest 0.9.0",
- "generic-array",
- "hmac",
-]
-
-[[package]]
-name = "im"
-version = "15.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9"
-dependencies = [
- "bitmaps",
- "rand_core 0.6.3",
- "rand_xoshiro",
- "rayon",
- "serde",
- "sized-chunks",
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "itertools"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
-dependencies = [
- "either",
-]
-
-[[package]]
-name = "itoa"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
-
-[[package]]
-name = "js-sys"
-version = "0.3.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "keccak"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.125"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
-
-[[package]]
-name = "libsecp256k1"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73"
-dependencies = [
- "arrayref",
- "base64 0.12.3",
- "digest 0.9.0",
- "hmac-drbg",
- "libsecp256k1-core",
- "libsecp256k1-gen-ecmult",
- "libsecp256k1-gen-genmult",
- "rand",
- "serde",
- "sha2 0.9.9",
- "typenum",
-]
-
-[[package]]
-name = "libsecp256k1-core"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80"
-dependencies = [
- "crunchy",
- "digest 0.9.0",
- "subtle",
-]
-
-[[package]]
-name = "libsecp256k1-gen-ecmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "libsecp256k1-gen-genmult"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d"
-dependencies = [
- "libsecp256k1-core",
-]
-
-[[package]]
-name = "lock_api"
-version = "0.4.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "memmap2"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num-derive"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "once_cell"
-version = "1.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
-
-[[package]]
-name = "opaque-debug"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
-
-[[package]]
-name = "pyth-wormhole-attester-sdk"
-version = "0.1.1"
-dependencies = [
- "hex",
- "pyth-sdk",
- "pyth-sdk-solana",
- "serde",
- "solana-program",
- "solitaire",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
-dependencies = [
- "lock_api",
- "parking_lot_core",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929"
-dependencies = [
- "cfg-if",
- "libc",
- "redox_syscall",
- "smallvec",
- "windows-sys",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
-
-[[package]]
-name = "proc-macro-crate"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
-dependencies = [
- "toml",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9027b48e9d4c9175fa2218adf3557f91c1137021739951d4932f5f8268ac48aa"
-dependencies = [
- "unicode-xid",
-]
-
-[[package]]
-name = "pyth-sdk"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5c805ba3dfb5b7ed6a8ffa62ec38391f485a79c7cf6b3b11d3bd44fb0325824"
-dependencies = [
- "borsh",
- "borsh-derive",
- "hex",
- "schemars",
- "serde",
-]
-
-[[package]]
-name = "pyth-sdk-solana"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "286f2abd9fb718190206340f3d1f98a80b34df9d724887b907e7f6f24a31efce"
-dependencies = [
- "borsh",
- "borsh-derive",
- "bytemuck",
- "num-derive",
- "num-traits",
- "pyth-sdk",
- "serde",
- "solana-program",
- "thiserror",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "rand"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
-dependencies = [
- "getrandom 0.1.16",
- "libc",
- "rand_chacha",
- "rand_core 0.5.1",
- "rand_hc",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
-dependencies = [
- "ppv-lite86",
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
-dependencies = [
- "getrandom 0.1.16",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-
-[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_xoshiro"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
-dependencies = [
- "rand_core 0.6.3",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "num_cpus",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "rocksalt"
-version = "0.1.0"
-source = "git+https://github.com/wormhole-foundation/wormhole?tag=v2.8.9#e47f9e481ef84d4dea7a94c9eafbf3b180892466"
-dependencies = [
- "byteorder",
- "proc-macro2",
- "quote",
- "sha3 0.9.1",
- "solana-program",
- "syn",
-]
-
-[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rustversion"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
-
-[[package]]
-name = "ryu"
-version = "1.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
-
-[[package]]
-name = "schemars"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c6b5a3c80cea1ab61f4260238409510e814e38b4b563c06044edf91e7dc070e3"
-dependencies = [
- "dyn-clone",
- "schemars_derive",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "schemars_derive"
-version = "0.8.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41ae4dce13e8614c46ac3c38ef1c0d668b101df6ac39817aebdaa26642ddae9b"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde_derive_internals",
- "syn",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "semver"
-version = "1.0.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd"
-
-[[package]]
-name = "serde"
-version = "1.0.137"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_bytes"
-version = "0.11.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "212e73464ebcde48d723aa02eb270ba62eff38a9b732df31f33f1b4e145f3a54"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.137"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_derive_internals"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1dbab34ca63057a1f15280bdf3c39f2b1eb1b54c17e98360e511637aef7418c6"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.81"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c"
-dependencies = [
- "itoa",
- "ryu",
- "serde",
-]
-
-[[package]]
-name = "sha2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800"
-dependencies = [
- "block-buffer 0.9.0",
- "cfg-if",
- "cpufeatures",
- "digest 0.9.0",
- "opaque-debug",
-]
-
-[[package]]
-name = "sha2"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest 0.10.3",
-]
-
-[[package]]
-name = "sha3"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
-dependencies = [
- "block-buffer 0.9.0",
- "digest 0.9.0",
- "keccak",
- "opaque-debug",
-]
-
-[[package]]
-name = "sha3"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86"
-dependencies = [
- "digest 0.10.3",
- "keccak",
-]
-
-[[package]]
-name = "sized-chunks"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e"
-dependencies = [
- "bitmaps",
- "typenum",
-]
-
-[[package]]
-name = "smallvec"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
-
-[[package]]
-name = "solana-frozen-abi"
-version = "1.10.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68f2b153f8eb8c4d22f2b739d3d31bac4122ca17376869cb717bf3a45200ea63"
-dependencies = [
- "bs58",
- "bv",
- "generic-array",
- "im",
- "lazy_static",
- "log",
- "memmap2",
- "rustc_version",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.10.2",
- "solana-frozen-abi-macro",
- "thiserror",
-]
-
-[[package]]
-name = "solana-frozen-abi-macro"
-version = "1.10.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0cd23aad847403a28dd1452611490b5e8f040470ed251882cca0492c5e566280"
-dependencies = [
- "proc-macro2",
- "quote",
- "rustc_version",
- "syn",
-]
-
-[[package]]
-name = "solana-program"
-version = "1.10.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37be82a1fe85b24aa036153650053fd9628489c07c834b6b2dc027c4052bdbe5"
-dependencies = [
- "base64 0.13.0",
- "bincode",
- "bitflags",
- "blake3",
- "borsh",
- "borsh-derive",
- "bs58",
- "bv",
- "bytemuck",
- "console_error_panic_hook",
- "console_log",
- "curve25519-dalek",
- "getrandom 0.1.16",
- "itertools",
- "js-sys",
- "lazy_static",
- "libsecp256k1",
- "log",
- "num-derive",
- "num-traits",
- "parking_lot",
- "rand",
- "rustc_version",
- "rustversion",
- "serde",
- "serde_bytes",
- "serde_derive",
- "sha2 0.10.2",
- "sha3 0.10.1",
- "solana-frozen-abi",
- "solana-frozen-abi-macro",
- "solana-sdk-macro",
- "thiserror",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "solana-sdk-macro"
-version = "1.10.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "275c52edaaaa86ce649a226c03f75579d570c01880a43ee1de77a973994754ce"
-dependencies = [
- "bs58",
- "proc-macro2",
- "quote",
- "rustversion",
- "syn",
-]
-
-[[package]]
-name = "solitaire"
-version = "0.1.0"
-source = "git+https://github.com/wormhole-foundation/wormhole?tag=v2.8.9#e47f9e481ef84d4dea7a94c9eafbf3b180892466"
-dependencies = [
- "borsh",
- "byteorder",
- "rocksalt",
- "sha3 0.9.1",
- "solana-program",
-]
-
-[[package]]
-name = "subtle"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-
-[[package]]
-name = "syn"
-version = "1.0.94"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-xid",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "toml"
-version = "0.5.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
-dependencies = [
- "serde",
-]
-
-[[package]]
-name = "typenum"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
-
-[[package]]
-name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad"
-dependencies = [
- "cfg-if",
- "serde",
- "serde_json",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4"
-dependencies = [
- "bumpalo",
- "lazy_static",
- "log",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.80"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744"
-
-[[package]]
-name = "web-sys"
-version = "0.3.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "windows-sys"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
-dependencies = [
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_msvc",
-]
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.36.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
-
-[[package]]
-name = "zeroize"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"

+ 0 - 2
wormhole_attester/sdk/rust/Cargo.toml

@@ -11,14 +11,12 @@ crate-type = ["cdylib", "rlib"]
 [features]
 default = []
 solana  = ["solitaire", "solana-program", "pyth-sdk-solana"]
-wasm    = ["wasm-bindgen", "solana"]
 
 [dependencies]
 hex = "0.4.3"
 serde = { version = "1.0.103", default-features = false, features = ["derive"] }
 pyth-sdk = {version = "0.5.0"}
 pyth-sdk-solana = { version = "0.5.0", optional = true }
-wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional = true}
 solitaire = { git = "https://github.com/wormhole-foundation/wormhole", tag = "v2.8.9", optional = true}
 solana-program = { version = "=1.10.31", optional = true }
 

+ 2 - 10
wormhole_attester/sdk/rust/src/lib.rs

@@ -34,14 +34,6 @@ use {
     },
 };
 
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-pub mod wasm;
-
-#[cfg(feature = "wasm")]
-#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
-use wasm_bindgen::prelude::*;
-
 pub type ErrBox = Box<dyn std::error::Error>;
 
 /// Precedes every message implementing the p2w serialization format
@@ -527,7 +519,7 @@ mod tests {
             status:                     PriceStatus::Trading,
             num_publishers:             123212u32,
             max_num_publishers:         321232u32,
-            attestation_time:           (0xdeadbeeffadedeedu64) as i64,
+            attestation_time:           (0xdeadbeeffadeu64) as i64,
             publish_time:               0xdadebeefi64,
             prev_publish_time:          0xdeadbabei64,
             prev_price:                 0xdeadfacebeefi64,
@@ -567,7 +559,7 @@ mod tests {
 
     #[test]
     fn test_batch_serde() -> Result<(), ErrBox> {
-        let attestations: Vec<_> = (1..=10)
+        let attestations: Vec<_> = (1..=3)
             .map(|i| {
                 mock_attestation(
                     Some([(i % 256) as u8; 32]),

+ 0 - 33
wormhole_attester/sdk/rust/src/wasm.rs

@@ -1,33 +0,0 @@
-use {
-    crate::{
-        BatchPriceAttestation,
-        P2WEmitter,
-        PriceAttestation,
-    },
-    solana_program::pubkey::Pubkey,
-    solitaire::Seeded,
-    std::str::FromStr,
-    wasm_bindgen::prelude::*,
-};
-
-#[wasm_bindgen]
-pub fn get_emitter_address(program_id: String) -> Vec<u8> {
-    let program_id = Pubkey::from_str(program_id.as_str()).unwrap();
-    let emitter = P2WEmitter::key(None, &program_id);
-
-    emitter.to_bytes().to_vec()
-}
-
-#[wasm_bindgen]
-pub fn parse_attestation(bytes: Vec<u8>) -> JsValue {
-    let a = PriceAttestation::deserialize(bytes.as_slice()).unwrap();
-
-    JsValue::from_serde(&a).unwrap()
-}
-
-#[wasm_bindgen]
-pub fn parse_batch_attestation(bytes: Vec<u8>) -> JsValue {
-    let a = BatchPriceAttestation::deserialize(bytes.as_slice()).unwrap();
-
-    JsValue::from_serde(&a).unwrap()
-}

Неке датотеке нису приказане због велике количине промена