Skip to content

Commit 70fd0a6

Browse files
authored
[wormhole-attester] Move p2w-sdk inside wormhole_attester directory (#534)
* Move p2w-sdk to wormhole_attester * Update references to the sdk
1 parent 3af759b commit 70fd0a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+148
-185
lines changed

.github/workflows/pyth-cosmwasm-contract.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
pull_request:
55
paths:
66
- target_chains/cosmwasm/**
7-
- third_party/pyth/p2w-sdk/rust/**
7+
- wormhole_attester/sdk/rust/**
88
push:
99
branches:
1010
- main
1111
paths:
1212
- target_chains/cosmwasm/**
13-
- third_party/pyth/p2w-sdk/rust/**
13+
- wormhole_attester/sdk/rust/**
1414

1515
env:
1616
CARGO_TERM_COLOR: always

.pre-commit-config.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,3 @@ repos:
5858
entry: cargo +nightly clippy --manifest-path ./target_chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
5959
pass_filenames: false
6060
files: target_chains/cosmwasm
61-
# Hooks for p2w-sdk/rust
62-
- id: cargo-fmt-p2w-sdk
63-
name: Cargo format for p2w-sdk
64-
language: "rust"
65-
entry: cargo +nightly fmt --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --all -- --config-path rustfmt.toml
66-
pass_filenames: false
67-
files: third_party/pyth/p2w-sdk/rust
68-
- id: cargo-clippy-p2w-sdk
69-
name: Cargo clippy for p2w-sdk
70-
language: "rust"
71-
entry: cargo +nightly clippy --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
72-
pass_filenames: false
73-
files: third_party/pyth/p2w-sdk/rust

price_service/server/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ ARG BASE_PATH=/usr/src/pyth2wormhole
44
RUN addgroup -S pyth -g 10001 && adduser -S pyth -G pyth -u 10001
55
USER pyth
66

7-
# Adds p2w-sdk/js dependency
8-
ARG P2W_SDK_REL_PATH=third_party/pyth/p2w-sdk/js
9-
WORKDIR ${BASE_PATH}/${P2W_SDK_REL_PATH}
10-
COPY --chown=pyth:pyth ${P2W_SDK_REL_PATH} .
7+
# Adds wormhole_attester/sdk/js dependency
8+
ARG ATTESTER_SDK_REL_PATH=wormhole_attester/sdk/js
9+
WORKDIR ${BASE_PATH}/${ATTESTER_SDK_REL_PATH}
10+
COPY --chown=pyth:pyth ${ATTESTER_SDK_REL_PATH} .
1111
RUN npm ci && npm run build && npm cache clean --force
1212

1313
ARG PRICE_SERVICE_REL_PATH=price_service/server

price_service/server/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ price service you should:
4646

4747
## Build an image
4848

49-
First, build the wasm files from [the repo root](../../../) like below. This command generates the wasm files necessary
50-
for parsing Pyth messages coming from Wormhole and stores them on [this](../p2w-sdk/js/src/solana/p2w-core) directory.
49+
First, build the wasm files from [the repo root](../../) like below. This command generates the wasm files necessary
50+
for parsing Pyth messages coming from Wormhole and stores them on [this](../../wormhole_attester/sdk/js) directory.
5151

5252
```
53-
docker buildx build -f Dockerfile.wasm -o type=local,dest=. .
53+
docker buildx build -f tilt_devnet/docker_images/Dockerfile.wasm -o type=local,dest=. .
5454
```
5555

56-
Then, build the image from [the repo root](../../../) like below. It will create a
56+
Then, build the image from [the repo root](../../) like below. It will create a
5757
local image named `pyth_price_server`.
5858

5959
```

price_service/server/package-lock.json

Lines changed: 13 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

price_service/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"dependencies": {
3232
"@certusone/wormhole-sdk": "^0.9.9",
3333
"@certusone/wormhole-spydk": "^0.0.1",
34-
"@pythnetwork/p2w-sdk-js": "file:../../third_party/pyth/p2w-sdk/js",
3534
"@pythnetwork/pyth-sdk-js": "^1.1.0",
35+
"@pythnetwork/wormhole-attester-sdk": "file:../../wormhole_attester/sdk/js",
3636
"@types/cors": "^2.8.12",
3737
"@types/express": "^4.17.13",
3838
"@types/morgan": "^1.9.3",

price_service/server/src/listen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
getBatchSummary,
1515
parseBatchPriceAttestation,
1616
priceAttestationToPriceFeed,
17-
} from "@pythnetwork/p2w-sdk-js";
17+
} from "@pythnetwork/wormhole-attester-sdk";
1818
import { HexString, PriceFeed } from "@pythnetwork/pyth-sdk-js";
1919
import LRUCache from "lru-cache";
2020
import { DurationInSec, sleep, TimestampInSec } from "./helpers";

price_service/server/src/logging.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ export function initLogger(config?: { logLevel?: string }) {
1313

1414
let transport: any;
1515
// tslint:disable:no-console
16-
console.log("p2w_api is logging to the console at level [%s]", logLevel);
16+
console.log(
17+
"price_service is logging to the console at level [%s]",
18+
logLevel
19+
);
1720

1821
transport = new winston.transports.Console({
1922
level: logLevel,

target_chains/cosmwasm/Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

target_chains/cosmwasm/contracts/pyth/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ generic-array = { version = "0.14.4" }
2828
hex = "0.4.2"
2929
lazy_static = "1.4.0"
3030
bigint = "4"
31-
p2w-sdk = { path = "../../../../third_party/pyth/p2w-sdk/rust" }
31+
pyth-wormhole-attester-sdk = { path = "../../../../wormhole_attester/sdk/rust" }
3232
pyth-sdk = "0.7.0"
3333
byteorder = "1.4.3"
3434
cosmwasm-schema = "1.1.9"

0 commit comments

Comments
 (0)