forked from wormhole-foundation/wormhole
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk/js: Near refactor, added integration tests (wormhole-foundation#1648
) * near-sdk-refactor: Fix attest : Fix missing function calls : make near on near : renamed tryHexToNativeStringNear * near-sdk-refactor: bumped near-sdk-js version Co-authored-by: Josh Siegel <jsiegel@jumptrading.com>
- Loading branch information
1 parent
02cf085
commit c5d2f9d
Showing
38 changed files
with
1,016 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// run this script with truffle exec | ||
|
||
const jsonfile = require("jsonfile"); | ||
const TokenBridge = artifacts.require("TokenBridge"); | ||
const BridgeImplementationFullABI = jsonfile.readFileSync( | ||
"../build/contracts/BridgeImplementation.json" | ||
).abi; | ||
const nearTokenBridgeVAA = process.env.REGISTER_NEAR_TOKEN_BRIDGE_VAA; | ||
|
||
module.exports = async function (callback) { | ||
try { | ||
const accounts = await web3.eth.getAccounts(); | ||
const tokenBridge = new web3.eth.Contract( | ||
BridgeImplementationFullABI, | ||
TokenBridge.address | ||
); | ||
|
||
// Register the near token bridge endpoint | ||
await tokenBridge.methods.registerChain("0x" + nearTokenBridgeVAA).send({ | ||
value: 0, | ||
from: accounts[0], | ||
gasLimit: 2000000, | ||
}); | ||
|
||
callback(); | ||
} catch (e) { | ||
callback(e); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM debian@sha256:2ce44bbc00a79113c296d9d25524e15d423b23303fdbbe20190d2f96e0aeb251 as build | ||
|
||
RUN apt-get update && apt-get install -y curl \ | ||
make \ | ||
build-essential | ||
|
||
WORKDIR /app | ||
COPY ./setup-rust.sh . | ||
RUN ./setup-rust.sh | ||
|
||
COPY . . | ||
|
||
RUN ./build-contracts.sh | ||
|
||
FROM node:16-alpine@sha256:004dbac84fed48e20f9888a23e32fa7cf83c2995e174a78d41d9a9dd1e051a20 AS deploy | ||
|
||
WORKDIR /app | ||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY .env . | ||
COPY devnet_deploy.sh . | ||
COPY devnet_deploy.ts . | ||
COPY --from=build /app/contracts/*/target/wasm32-unknown-unknown/release/*.wasm . | ||
|
||
# mount the buildkit cache on npm's cache dir, install dependencies | ||
RUN --mount=type=cache,target=/root/.npm npm ci --production | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.