Skip to content

Commit

Permalink
Merge pull request #1 from Move-Flow/cs/moveflow
Browse files Browse the repository at this point in the history
Bug fix when running test of layerzero's code
  • Loading branch information
livelybug authored Nov 23, 2023
2 parents 991a2f2 + 440a712 commit 3205133
Show file tree
Hide file tree
Showing 24 changed files with 927 additions and 387 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ aptos node run-local-testnet --force-restart --assume-yes --with-faucet
then execute tests
```shell
cd sdk
npm install
npx jest ./tests/omniCounter.test.ts
npx jest ./tests/bridge.test.ts
```
2 changes: 1 addition & 1 deletion apps/counter/sources/counter.move
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module counter::counter {
lz_receive_internal(chain_id, src_address, payload);
}

public entry fun lz_receive_types(_src_chain_id: u64, _src_address: vector<u8>, _payload: vector<u8>) : vector<type_info::TypeInfo> {
public fun lz_receive_types(_src_chain_id: u64, _src_address: vector<u8>, _payload: vector<u8>) : vector<type_info::TypeInfo> {
vector::empty<type_info::TypeInfo>()
}

Expand Down
2 changes: 1 addition & 1 deletion layerzero-common/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ layerzero_common = "_"
[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-core.git"
subdir = "aptos-move/framework/aptos-framework"
rev = "895ae28e4a105430d8b9d2ce2f6e48c3b2c7fcf0"
rev = "2a332586aa4ec6b6eb5372b43e6b13d40061c6a5"
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
"@layerzerolabs/core-sdk": "^1.0.41-beta.37",
"@layerzerolabs/lz-sdk": "^0.0.50",
"@noble/hashes": "^1.1.2",
"@types/bn.js": "^5.1.0",
"@types/command-line-args": "^5.2.0",
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"
import { Environment } from "./types"

export const NODE_URL: { [env in Environment]: string } = {
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import invariant from "tiny-invariant"
import { Layerzero } from "./modules"
import { applyGasLimitSafety, MultipleSignFunc, multiSigSignedBCSTxn } from "./utils"
import { LAYERZERO_ADDRESS } from "./constants"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

export * as utils from "./utils"
export * as modules from "./modules"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/config/common.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, ChainStage } from "@layerzerolabs/core-sdk"
import { ChainId, ChainStage } from "@layerzerolabs/lz-sdk"

export type ConfigType = {
msglib: {
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId, ChainStage } from "@layerzerolabs/core-sdk"
import { ChainId, ChainStage } from "@layerzerolabs/lz-sdk"
import { getConfig as SandboxConfig } from "./sandbox"
import { getConfig as TestnetConfig } from "./testnet"
import { getConfig as MainnetConfig } from "./mainnet"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/config/mainnet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { applyArbitrumMultiplier, ConfigType, DEFAULT_BLOCK_CONFIRMATIONS, EVM_ADDERSS_SIZE } from "./common"
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/core-sdk"
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/lz-sdk"
import {
BRIDGE_ADDRESS,
EXECUTOR_ADDRESS,
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/config/sandbox.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/core-sdk"
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/lz-sdk"
import { evmBridgeAddresses, TOKEN_ADDRESSES } from "../../../apps/bridge-evm/tasks/config/addresses"
import { applyArbitrumMultiplier, ConfigType, DEFAULT_BLOCK_CONFIRMATIONS, EVM_ADDERSS_SIZE } from "./common"
import { CoinType } from "../../src/modules/apps/coin"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/config/testnet.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/core-sdk"
import { CHAIN_KEY, ChainId, ChainStage } from "@layerzerolabs/lz-sdk"
import { evmBridgeAddresses, TOKEN_ADDRESSES } from "../../../apps/bridge-evm/tasks/config/addresses"
import { applyArbitrumMultiplier, ConfigType, DEFAULT_BLOCK_CONFIRMATIONS, EVM_ADDERSS_SIZE } from "./common"
import { CoinType } from "../../src/modules/apps/coin"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/deploy/deployBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as path from "path"
import { BRIDGE_MODULES, compilePackage, getMetadataAndModules } from "../utils"
import { FAUCET_URL, NODE_URL } from "../../src/constants"
import { Environment } from "../../src/types"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

export async function deployBridge(
env: Environment,
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/deploy/deployCounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as layerzero from "../../src"
import * as path from "path"
import { compilePackage, COUNTER_MODULES, getMetadataAndModules } from "../utils"
import { Environment } from "../../src/types"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

export async function deployCounter(
env: Environment,
Expand Down
5 changes: 5 additions & 0 deletions sdk/tasks/deploy/deployLayerzero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ export async function deployLayerzero(env: Environment, endpointId: number, acco

console.log("Deployed Layerzero!!")
}

/*
export async function deployLayerzero(env: Environment, endpointId: number, account: aptos.AptosAccount) {
}*/
2 changes: 1 addition & 1 deletion sdk/tasks/deploy/deployOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as fs from "fs"
import { Oracle } from "../../src/modules/apps/oracle"
import { compilePackage, ORACLE_MODULES } from "../utils"
import { Environment } from "../../src/types"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

export async function deployOracle(
env: Environment,
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/deploy/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from "./deployBridge"
export * from "./deployLayerZero"
export * from "./deployLayerzero"
export * from "./deployOracle"
export * from "./deployCounter"
export * from "./deployZro"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env -S npx ts-node
import * as commander from "commander"
import { CHAIN_ID } from "@layerzerolabs/core-sdk"
import { CHAIN_ID } from "@layerzerolabs/lz-sdk"
import { wireAll } from "./wireAll"
import { LzConfig, NETWORK_NAME } from "./config"
import {
Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as commander from "commander"
import { Environment } from "../src/types"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

export const OPTION_PROMPT = new commander.Option("-p, --prompt <prompt>", "prompt for confirmation").default(true)

Expand Down
4 changes: 2 additions & 2 deletions sdk/tasks/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CHAIN_STAGE, ChainKey, ChainStage } from "@layerzerolabs/core-sdk"
import { CHAIN_STAGE, ChainKey, ChainStage } from "@layerzerolabs/lz-sdk"
import { getAccount, KeyType } from "../src/utils"
import * as aptos from "aptos"
import invariant from "tiny-invariant"
Expand Down Expand Up @@ -36,7 +36,7 @@ export const LAYERZERO_MODULES = [
"endpoint.mv",
"lzapp.mv",
"remote.mv",
"oft.mv",
// "oft.mv",
"uln_receive.mv",
]

Expand Down
2 changes: 1 addition & 1 deletion sdk/tasks/wireAll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigType } from "./config"
import { CHAIN_ID, ChainStage } from "@layerzerolabs/core-sdk"
import { CHAIN_ID, ChainStage } from "@layerzerolabs/lz-sdk"
import { FAUCET_URL, NODE_URL } from "../src/constants"
import * as aptos from "aptos"
import { Oracle } from "../src/modules/apps/oracle"
Expand Down
2 changes: 1 addition & 1 deletion sdk/tests/bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import * as _ from "lodash"
import { findSecretKeyWithZeroPrefix } from "./utils"
import { FAUCET_URL, NODE_URL } from "../src/constants"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

const env = Environment.LOCAL

Expand Down
2 changes: 1 addition & 1 deletion sdk/tests/omniCounter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import { getTestConfig } from "../tasks/config/local"
import { findSecretKeyWithZeroPrefix } from "./utils"
import { FAUCET_URL, NODE_URL } from "../src/constants"
import { ChainStage } from "@layerzerolabs/core-sdk"
import { ChainStage } from "@layerzerolabs/lz-sdk"

const env = Environment.LOCAL

Expand Down
Loading

0 comments on commit 3205133

Please sign in to comment.