Skip to content

Commit

Permalink
Merge branch 'main' into chore/add-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jul 10, 2024
2 parents a70d2e2 + 27fcf68 commit 99e6f94
Show file tree
Hide file tree
Showing 60 changed files with 3,476 additions and 3,438 deletions.
5 changes: 3 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "richardpringle",
"extends": ["richardpringle", "plugin:@typescript-eslint/recommended"],
"env": {
"es2020": true,
"mocha": true
},
"rules": {
"no-unused-expressions": "off"
"no-unused-expressions": "off",
"@typescript-eslint/no-var-requires": "off",
}
}
82 changes: 82 additions & 0 deletions .github/workflows/test-js.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Javascript Tests

on:
pull_request:
push:
branches:
- main
- releases/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
SUI_VERSION: mainnet-v1.25.3

jobs:
test-js:
runs-on: ubuntu-latest

steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev
- name: Cache Sui binaries
id: cache-sui
uses: actions/cache/restore@v4
with:
path: sui-binaries-skip/
key: sui-${{ env.SUI_VERSION }}

- name: Download and Install Sui
if: steps.cache-sui.outputs.cache-hit != 'true'
run: |
curl -L -o sui-${SUI_VERSION}-ubuntu-x86_64.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz
tar -xvf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
mkdir -p sui-binaries
mv ./sui ./sui-binaries/
mv ./sui-debug ./sui-binaries/
mv ./sui-test-validator ./sui-binaries/
rm -rf sui-${SUI_VERSION}-ubuntu-x86_64.tgz
- name: Save Sui binaries
if: steps.cache-sui.outputs.cache-hit != 'true'
id: cache-sui-save
uses: actions/cache/save@v4
with:
path: sui-binaries/
key: ${{ steps.cache-sui.outputs.cache-primary-key }}

- name: Add Sui binaries to PATH
run: |
sudo cp ./sui-binaries/sui /usr/local/bin/sui
sudo cp ./sui-binaries/sui-debug /usr/local/bin/sui-debug
sudo cp ./sui-binaries/sui-test-validator /usr/local/bin/sui-test-validator
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run Localnet
run: nohup sh -c "sui-test-validator" > nohup.out 2> nohup.err < /dev/null &

- name: Sleep for 30 seconds
run: sleep 30s
shell: bash

- name: Test
run: npm run test-js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Move Tests

on:
pull_request:
Expand All @@ -15,7 +15,7 @@ env:
SUI_VERSION: mainnet-v1.25.3

jobs:
test:
test-move:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -30,4 +30,4 @@ jobs:
run: npm run build

- name: Test
run: npm run test
run: npm run test-move
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ target/
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# dist and move_compile
dist
move_comile
3 changes: 3 additions & 0 deletions .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exit: true
spec: test/**/*.js
timeout: 300000
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
"trailingComma": "all"
}
},
{
"files": "*.ts",
"options": {
"trailingComma": "all"
}
},
{
"files": "*.json",
"options": {
Expand Down
4 changes: 2 additions & 2 deletions move/abi/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[move]
version = 2
manifest_digest = "7DED727D47EB51E5059409B19CC373C6D9AF249D837E9153E7368F3898025E41"
manifest_digest = "134C22A16B63D227C88D4E1F5D02607C8E7C2D0FA5D3BAD6136E0041F441654D"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
Expand All @@ -21,6 +21,6 @@ dependencies = [
]

[move.toolchain-version]
compiler-version = "1.25.1"
compiler-version = "1.26.1"
edition = "2024.beta"
flavor = "sui"
3 changes: 2 additions & 1 deletion move/abi/Move.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[package]
name = "Abi"
version = "0.1.0"
published-at = "0x41fb7e9c9d8851ecbfd4b89c910c0465de0cd0cf757c4bb261a8a6019ea33390"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" }

[addresses]
abi = "0x103"
abi = "0x0"
4 changes: 0 additions & 4 deletions move/abi/info.json

This file was deleted.

4 changes: 2 additions & 2 deletions move/axelar_gateway/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[move]
version = 2
manifest_digest = "11FAF5CFE0A4A2EBCD5E370FAD144FFF14243A85492B718A2B26A15CF7F0B571"
manifest_digest = "1EB54C26C3FA638760DAA54E631C0B13A09FFC472C1CAA730C9A7879E463B455"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
Expand All @@ -21,6 +21,6 @@ dependencies = [
]

[move.toolchain-version]
compiler-version = "1.25.1"
compiler-version = "1.26.1"
edition = "2024.beta"
flavor = "sui"
3 changes: 2 additions & 1 deletion move/axelar_gateway/Move.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[package]
name = "AxelarGateway"
version = "0.1.0"
published-at = "0xe44f3fb828db14a0dd991de2aed9c987ee49faf7c31bf819b986a058a38e9935"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" }

[addresses]
axelar_gateway = "0x100"
axelar_gateway = "0xcd391ade5ab55a218f8988df8f3aa38ec019651c217244f7f689616c87d8c289"
clock = "0x6"
6 changes: 0 additions & 6 deletions move/axelar_gateway/info.json

This file was deleted.

17 changes: 17 additions & 0 deletions move/axelar_gateway/sources/channel.move
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,23 @@ module axelar_gateway::channel {
// Tests
// -----

#[test_only]
public fun new_approved_message(
source_chain: String,
message_id: String,
source_address: String,
destination_id: address,
payload: vector<u8>,
): ApprovedMessage {
ApprovedMessage {
source_chain,
message_id,
source_address,
destination_id,
payload
}
}

#[test]
fun test_new_and_destroy() {
let ctx = &mut sui::tx_context::dummy();
Expand Down
4 changes: 2 additions & 2 deletions move/gas_service/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[move]
version = 2
manifest_digest = "C1DEC087FF16954984395BB68E2E81D4A38E64A7F0BAB88AAF73A121C563E2D4"
manifest_digest = "A020C8D244BDE64D6F5F3107506F682AEA99E933953DE1FB01352999724E43EB"
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082"
dependencies = [
{ name = "Sui" },
Expand All @@ -21,6 +21,6 @@ dependencies = [
]

[move.toolchain-version]
compiler-version = "1.25.1"
compiler-version = "1.26.1"
edition = "2024.beta"
flavor = "sui"
3 changes: 2 additions & 1 deletion move/gas_service/Move.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[package]
name = "GasService"
version = "0.1.0"
published-at = "0x9249adc3fac09edb21a0848af2ccf4901ffb3689124bc91d67bc613903ca643c"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.25.3" }

[addresses]
gas_service = "0x105"
gas_service = "0x9249adc3fac09edb21a0848af2ccf4901ffb3689124bc91d67bc613903ca643c"
5 changes: 0 additions & 5 deletions move/gas_service/info.json

This file was deleted.

4 changes: 2 additions & 2 deletions move/governance/Move.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[move]
version = 2
manifest_digest = "4F26118CD341A5D382F6D63184C33AE0DEFBC380DA34B844908B98C7C2B228D9"
manifest_digest = "9DC4C192CAEBB80F2FBB1DC3CCEC7F9714E98AF18EBC9396F08BDB826A59E4F3"
deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3"
dependencies = [
{ name = "Abi" },
Expand Down Expand Up @@ -39,6 +39,6 @@ dependencies = [
]

[move.toolchain-version]
compiler-version = "1.25.1"
compiler-version = "1.26.1"
edition = "2024.beta"
flavor = "sui"
3 changes: 2 additions & 1 deletion move/governance/Move.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "Governance"
version = "0.1.0"
published-at = "0x0cba440261d721bde9c85eafe18aae673ee72702fa95da567675b34224f5ad77"
edition = "2024.beta"

[dependencies]
Expand All @@ -9,4 +10,4 @@ AxelarGateway = { local = "../axelar_gateway" }
Abi = { local = "../abi" }

[addresses]
governance = "0x101"
governance = "0x0cba440261d721bde9c85eafe18aae673ee72702fa95da567675b34224f5ad77"
4 changes: 0 additions & 4 deletions move/governance/info.json

This file was deleted.

Loading

0 comments on commit 99e6f94

Please sign in to comment.