Clients: Clients governance wormhole relayer (#3103)
* clients/js uses wormhole sdk for relayer governance actions * Add improbable-eng dependency * Use SDK in clients/js for wormhole relayer * Remove invalid comment
This commit is contained in:
parent
9e61d151c6
commit
e422b48418
|
@ -10,8 +10,9 @@
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
||||||
"@certusone/wormhole-sdk": "^0.9.18",
|
"@certusone/wormhole-sdk": "^0.9.19-beta.0",
|
||||||
"@cosmjs/encoding": "^0.26.2",
|
"@cosmjs/encoding": "^0.26.2",
|
||||||
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||||
"@injectivelabs/networks": "^1.10.7",
|
"@injectivelabs/networks": "^1.10.7",
|
||||||
"@injectivelabs/sdk-ts": "^1.10.47",
|
"@injectivelabs/sdk-ts": "^1.10.47",
|
||||||
"@injectivelabs/utils": "^1.10.5",
|
"@injectivelabs/utils": "^1.10.5",
|
||||||
|
@ -492,16 +493,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@certusone/wormhole-sdk": {
|
"node_modules/@certusone/wormhole-sdk": {
|
||||||
"version": "0.9.18",
|
"version": "0.9.19-beta.0",
|
||||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.18.tgz",
|
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.19-beta.0.tgz",
|
||||||
"integrity": "sha512-0YtrdZmjfiUHL78Yr4FA59ywb+pIevbID/TJpJTp/EKWqm/v+9PS4YBMBEtjpDZR/PSqe6hB8MasF38fUjMGtQ==",
|
"integrity": "sha512-kON/RWR/LJK9/oUerZ0NYY2CYptwHoQTjC2RAHpDzaM57hQBDOOsKGNVzlwcXdUv8lVSBymijW9+4VXMAQiZqw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
||||||
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||||
"@coral-xyz/borsh": "0.2.6",
|
"@coral-xyz/borsh": "0.2.6",
|
||||||
"@injectivelabs/networks": "1.10.12",
|
|
||||||
"@injectivelabs/sdk-ts": "1.10.72",
|
|
||||||
"@injectivelabs/utils": "1.10.12",
|
|
||||||
"@mysten/sui.js": "0.32.2",
|
"@mysten/sui.js": "0.32.2",
|
||||||
"@project-serum/anchor": "^0.25.0",
|
"@project-serum/anchor": "^0.25.0",
|
||||||
"@solana/spl-token": "^0.3.5",
|
"@solana/spl-token": "^0.3.5",
|
||||||
|
@ -517,6 +515,11 @@
|
||||||
"elliptic": "^6.5.4",
|
"elliptic": "^6.5.4",
|
||||||
"js-base64": "^3.6.1",
|
"js-base64": "^3.6.1",
|
||||||
"near-api-js": "^1.0.0"
|
"near-api-js": "^1.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@injectivelabs/networks": "1.10.12",
|
||||||
|
"@injectivelabs/sdk-ts": "1.10.72",
|
||||||
|
"@injectivelabs/utils": "1.10.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@certusone/wormhole-sdk-proto-web": {
|
"node_modules/@certusone/wormhole-sdk-proto-web": {
|
||||||
|
@ -1876,6 +1879,14 @@
|
||||||
"google-protobuf": "^3.14.0"
|
"google-protobuf": "^3.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@improbable-eng/grpc-web-node-http-transport": {
|
||||||
|
"version": "0.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz",
|
||||||
|
"integrity": "sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@improbable-eng/grpc-web": ">=0.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@injectivelabs/core-proto-ts": {
|
"node_modules/@injectivelabs/core-proto-ts": {
|
||||||
"version": "0.0.14",
|
"version": "0.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
||||||
|
@ -8491,9 +8502,9 @@
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"@certusone/wormhole-sdk": {
|
"@certusone/wormhole-sdk": {
|
||||||
"version": "0.9.18",
|
"version": "0.9.19-beta.0",
|
||||||
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.18.tgz",
|
"resolved": "https://registry.npmjs.org/@certusone/wormhole-sdk/-/wormhole-sdk-0.9.19-beta.0.tgz",
|
||||||
"integrity": "sha512-0YtrdZmjfiUHL78Yr4FA59ywb+pIevbID/TJpJTp/EKWqm/v+9PS4YBMBEtjpDZR/PSqe6hB8MasF38fUjMGtQ==",
|
"integrity": "sha512-kON/RWR/LJK9/oUerZ0NYY2CYptwHoQTjC2RAHpDzaM57hQBDOOsKGNVzlwcXdUv8lVSBymijW9+4VXMAQiZqw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
"@certusone/wormhole-sdk-proto-web": "0.0.6",
|
||||||
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||||
|
@ -9363,6 +9374,12 @@
|
||||||
"browser-headers": "^0.4.1"
|
"browser-headers": "^0.4.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@improbable-eng/grpc-web-node-http-transport": {
|
||||||
|
"version": "0.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web-node-http-transport/-/grpc-web-node-http-transport-0.15.0.tgz",
|
||||||
|
"integrity": "sha512-HLgJfVolGGpjc9DWPhmMmXJx8YGzkek7jcCFO1YYkSOoO81MWRZentPOd/JiKiZuU08wtc4BG+WNuGzsQB5jZA==",
|
||||||
|
"requires": {}
|
||||||
|
},
|
||||||
"@injectivelabs/core-proto-ts": {
|
"@injectivelabs/core-proto-ts": {
|
||||||
"version": "0.0.14",
|
"version": "0.0.14",
|
||||||
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
"resolved": "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.14.tgz",
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
|
||||||
"@certusone/wormhole-sdk": "^0.9.18",
|
"@certusone/wormhole-sdk": "^0.9.19-beta.0",
|
||||||
"@cosmjs/encoding": "^0.26.2",
|
"@cosmjs/encoding": "^0.26.2",
|
||||||
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||||
"@injectivelabs/networks": "^1.10.7",
|
"@injectivelabs/networks": "^1.10.7",
|
||||||
"@injectivelabs/sdk-ts": "^1.10.47",
|
"@injectivelabs/sdk-ts": "^1.10.47",
|
||||||
"@injectivelabs/utils": "^1.10.5",
|
"@injectivelabs/utils": "^1.10.5",
|
||||||
|
|
|
@ -3,7 +3,11 @@ import {
|
||||||
BridgeImplementation__factory,
|
BridgeImplementation__factory,
|
||||||
Implementation__factory,
|
Implementation__factory,
|
||||||
NFTBridgeImplementation__factory,
|
NFTBridgeImplementation__factory,
|
||||||
|
WormholeRelayer__factory
|
||||||
} from "@certusone/wormhole-sdk/lib/esm/ethers-contracts";
|
} from "@certusone/wormhole-sdk/lib/esm/ethers-contracts";
|
||||||
|
import {
|
||||||
|
getWormholeRelayerAddress
|
||||||
|
} from "@certusone/wormhole-sdk/lib/esm/relayer"
|
||||||
import {
|
import {
|
||||||
CHAINS,
|
CHAINS,
|
||||||
CONTRACTS,
|
CONTRACTS,
|
||||||
|
@ -430,28 +434,26 @@ export async function execute_evm(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "WormholeRelayer":
|
case "WormholeRelayer":
|
||||||
// TODO: Try to get contract address from SDK if it is undefined
|
contract_address = contract_address
|
||||||
// Needs SDK to be published with Wormhole Relayer contract addresses
|
? contract_address
|
||||||
|
: getWormholeRelayerAddress(chain, network);
|
||||||
if (contract_address === undefined) {
|
if (contract_address === undefined) {
|
||||||
throw Error(`Unknown Wormhole Relayer contract on ${network} for ${chain}`)
|
throw Error(`Unknown Wormhole Relayer contract on ${network} for ${chain}`)
|
||||||
}
|
}
|
||||||
// let rb = ethers_contracts.WormholeRelayer__factory.connect(contract_address, signer)
|
let rb = WormholeRelayer__factory.connect(contract_address, signer)
|
||||||
switch (payload.type) {
|
switch (payload.type) {
|
||||||
case "ContractUpgrade":
|
case "ContractUpgrade":
|
||||||
console.log("Upgrading contract")
|
console.log("Upgrading contract")
|
||||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
console.log("Hash: " + (await rb.submitContractUpgrade(vaa, overrides)).hash)
|
||||||
//console.log("Hash: " + (await rb.submitContractUpgrade(vaa, overrides)).hash)
|
|
||||||
console.log("Don't forget to verify the new implementation! See ethereum/VERIFY.md for instructions")
|
console.log("Don't forget to verify the new implementation! See ethereum/VERIFY.md for instructions")
|
||||||
break
|
break
|
||||||
case "RegisterChain":
|
case "RegisterChain":
|
||||||
console.log("Registering chain")
|
console.log("Registering chain")
|
||||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
console.log("Hash: " + (await rb.registerWormholeRelayerContract(vaa, overrides)).hash)
|
||||||
//console.log("Hash: " + (await rb.registerWormholeRelayerContract(vaa, overrides)).hash)
|
|
||||||
break
|
break
|
||||||
case "SetDefaultDeliveryProvider":
|
case "SetDefaultDeliveryProvider":
|
||||||
console.log("Setting default relay provider")
|
console.log("Setting default relay provider")
|
||||||
console.log("Error: The published NPM SDK doesn't have the typechain binding for WormholeRelayer yet")
|
console.log("Hash: " + (await rb.setDefaultDeliveryProvider(vaa, overrides)).hash)
|
||||||
//console.log("Hash: " + (await rb.setDefaultDeliveryProvider(vaa, overrides)).hash)
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
impossible(payload)
|
impossible(payload)
|
||||||
|
|
Loading…
Reference in New Issue