Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev into default branch #78

Merged
merged 99 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
1e0e5fc
Caminojs renames (#7)
Chriserus Oct 26, 2022
3ae4a42
Fix reference test / add kopernikus to ci / .ignore changes / lint fixes
peak3d Nov 16, 2022
261531e
[Types] Implement CaminoAddValidatorTx and locked.Out
peak3d Nov 18, 2022
06cb9d8
[CI] camino-node / runner versions / e2e
peak3d Nov 19, 2022
1c6a8a3
Merge pull request #13 from chain4travel/locked
c4t-ag Nov 19, 2022
00335a7
[TYPES] Add LockedIn
peak3d Nov 19, 2022
7b64b8c
Merge pull request #14 from chain4travel/locked
c4t-ag Nov 19, 2022
c1f001e
[PVM] BaseIn/Output interfaces
peak3d Nov 20, 2022
aec1d3d
Merge pull request #15 from chain4travel/interface
c4t-ag Nov 21, 2022
83bf396
Rework CI rules
peak3d Nov 22, 2022
def6579
prettier-workflows
peak3d Nov 22, 2022
292a87e
Merge pull request #16 from chain4travel/ci
c4t-ag Nov 22, 2022
62bec1d
Fix caminojs examples
Chriserus Nov 22, 2022
2a55fea
Merge pull request #12 from chain4travel/examples-fix
Chriserus Nov 23, 2022
3c7388a
add support for multi addresses in platform.getbalance
aeddaqqa Dec 20, 2022
a6e3cf8
extend platform GetConfigurationResponse by lockModeBondDeposit and v…
aeddaqqa Dec 20, 2022
13da41d
extend the p-chain struct in the network interface with lockModeBondD…
aeddaqqa Dec 21, 2022
aaaacf0
[Examples] Cleanup
peak3d Jan 5, 2023
203a697
Add RegisterNodeTx + example
peak3d Jan 5, 2023
3ee6901
[BUILD] Remove husky / add CI prettier check
peak3d Jan 6, 2023
afa3f22
[TX] CaminoAddValidatorTx
peak3d Jan 6, 2023
14836da
[EXAMPLES] Change nodeID for RegisterNodeTx / AddValidatorTx
peak3d Jan 6, 2023
0c7765a
[TX] Add remaining platform tx to caminoExecutor (spend / lock)
peak3d Jan 9, 2023
f0a5bee
[TX] Add DepositTx
peak3d Jan 8, 2023
bfa8b15
[TX] AddressStateTx
peak3d Jan 12, 2023
896d94b
[API] getAddressStates / getMultisigAlias
peak3d Jan 16, 2023
8d73911
Add missing params in getMultisigAlias and getAddressStates calls (#24)
Chriserus Jan 17, 2023
fcc864e
Fix toJSON override, add instruction on creating a dist branch (#25)
Chriserus Jan 18, 2023
4bab382
[Add validator] Constants for getAddressState (#27)
Chriserus Jan 26, 2023
8077d74
[BN] Revert bn prototype overloading
peak3d Jan 30, 2023
2c9b385
Fix spend for ExportTx
peak3d Feb 1, 2023
5f4eaa3
GetClaimables call and example, readme adjustment (#30)
Chriserus Feb 2, 2023
7412a98
[API] Return deserialized GetBalanceResponse
peak3d Feb 1, 2023
f8ba2bf
Locked get methods
peak3d Feb 3, 2023
3e8cd36
Add getRegisteredShortIDLink and an example for that call (#35)
Chriserus Feb 16, 2023
6553761
Adjust addressstatetx.ts states (#37)
Chriserus Feb 16, 2023
fa96c9a
[Cleanup] Adjust versions / fix errors and linters
peak3d Feb 22, 2023
99585c8
Add getAllDepositOffers call and example (#38)
Chriserus Feb 22, 2023
f2c7dbe
[DEPENDENCIES] buffer / ethers
peak3d Feb 22, 2023
e6f066e
[Network] Fetch network always for non-predefined nets
peak3d Mar 1, 2023
ced2520
[UTXO] UTXOSet::getLockedIDs
peak3d Mar 1, 2023
b8832da
[Examples] use src path (configurable via tsconfig)
peak3d Mar 3, 2023
36c808f
[MSIG] MultiSigKeyChain / MultiSigKeyPair for signing UnsignedTx with…
peak3d Mar 3, 2023
ea0b701
[MSIG] Example + keychain generalization
peak3d Mar 3, 2023
4fbd2e4
[MultiSig] Implement 2 steps (resolveMultisigIndices -> sign)
peak3d Mar 10, 2023
644eb6f
[PlatformAPI] GetDeposits / Fix GetDepositOffers
peak3d Mar 13, 2023
c63e02b
Add .diff to npmignore
peak3d Mar 14, 2023
dc805fc
[E2E] Added e2e test for addValidator use case scenarios
knikos Mar 15, 2023
9f48a38
[Multisig] Implement new camino-node multisig logic
peak3d Mar 18, 2023
76b164f
[MSIG] RegisterNode and AddValidator Example with MSigAlias (#49)
Mar 20, 2023
283bb13
TECH-538-E2E-Test-SC-Deployment-from-(Non)-KYC-Verified-Addresses (#36)
parousisv Mar 22, 2023
651a6c9
[MultisigAliasReply] Memo -> memo
peak3d Mar 24, 2023
ba5add1
[E2E] Added test case for pChain deposit and unlockdeposit txs
knikos Mar 28, 2023
c63e485
[Network] Provide chain <-> alias array of all chains
peak3d Mar 29, 2023
c626d07
[PVM] Introduced claimtx and related api/builder functionality
knikos Mar 29, 2023
00339d2
[Multisig] Fix Traverse splice of wrong array (stack vs sigIdxs)
peak3d Mar 29, 2023
1870716
[Multisig] Added unit tests for multisig buildSignatureIndices
knikos Mar 30, 2023
86711a9
[PVM] Updated GetDepositsResponse and related api
knikos Mar 30, 2023
f0afa90
[PVM] Updated claimtx to include claimType
knikos Apr 6, 2023
b9d443a
[PVM] Removed redundant parameter from API getClaimables
knikos Apr 6, 2023
07a3bea
[PVM] Replaced claimableOwnersIDs with claimableOwners in API buildCl…
knikos Apr 6, 2023
4cba98a
[E2E] Added new e2e tests for multiSig txs
knikos Apr 6, 2023
365a0ad
[PVM] Get UTXOs from ExportTx
peak3d Apr 8, 2023
061a083
[EVM] ImportTx MultiSig
peak3d Apr 8, 2023
195dcff
[EVM] MultiSig compatibility
peak3d Apr 9, 2023
8bb9394
[PVM] Added unit tests for various txs incl. addressStateTx, claimTx,…
knikos Apr 10, 2023
9405ce4
[PVMAPI] Implement buildBaseTx
peak3d Apr 10, 2023
7a83b2b
[E2E] Multi Role Testing (#54)
parousisv Apr 12, 2023
ad00477
Give custom typeID on baseTx (#65)
charalarg Apr 12, 2023
334f651
[PVM][BaseTx] Fix wrong TypeId
peak3d Apr 15, 2023
d8e6010
[PVM] Added missing condition for claimtx in SelectTxClass
knikos Apr 20, 2023
7e00de9
[ClaimTx] Fix missing outputOwner / simplify signer parameter
peak3d Apr 20, 2023
59fbb41
[PVM] Fixed deserialization logic for claimtx field 'claimTo' (#68)
knikos Apr 21, 2023
24247bb
[ClaimTx] Rework according latest caminogo changes
peak3d Apr 23, 2023
d7e60d7
[GetClaimables] Interface change (multi owners)
peak3d Apr 24, 2023
2cebb52
[getDeposits] Add rewardOwner
peak3d Apr 24, 2023
c4468dc
[GetClaimable] Fix reading values from wrong source
peak3d Apr 25, 2023
d3525b6
[PVM][API] Owner / OwnerParam differentation
peak3d Apr 25, 2023
2a4e158
[PVM] Introduced e2e test for claiming validator rewards
knikos Apr 25, 2023
32fc55f
[CaminoAddVal] Add nodeOwnerAuth
peak3d Apr 25, 2023
73c279d
[PVM] Added getters in claimtx
knikos Apr 27, 2023
bb7400f
[API] Prepare getClaimable for reduced results
peak3d May 1, 2023
059ace8
[Platform][API] GetAllDepositOffers active -> timestamp request param…
peak3d May 4, 2023
27ac5e5
[TEST] Added unit tests for api functions
knikos May 4, 2023
1e93d27
[Platform] DepositOffer: add missing values (totalMax / deposited)
peak3d May 4, 2023
ac57b5a
[PVM] MultisigAlias and MultisigAliasTx implementation (#75)
charalarg May 30, 2023
0e8bb64
[E2E] Cross Chain MultiSig with Recipient E2E Testing
parousisv Jun 6, 2023
42355b6
feat(upgrade): merge avax 3.17.0 to dev
knikos Jun 20, 2023
154494c
test(e2e-validator-rewards): introduce new test cases for claiming va…
knikos Jun 21, 2023
d50544c
[PlatformVM][Deposit] Rework, Examples, UpgradeVersion
knikos Jun 22, 2023
fa7a538
[Platform][API]GetUpgradePhases + example
peak3d Jun 25, 2023
b901fdd
[Examples] Resolve multisig address from tx id
rafaelkordonias Jul 27, 2023
bccb967
[TX] Include AddDesositOfferTx Type in deserialization logic of Unsig…
knikos Jul 29, 2023
e78030b
[TX] Add getter for multisigalias owners (#82)
knikos Aug 14, 2023
e318728
[API] replace obsolete creationTxFee with createAssetTxFee in network…
knikos Sep 29, 2023
ee6bcbe
[TX] Fix owner auth signatures indices and destination address for De…
knikos Nov 2, 2023
59b3224
feat: add unlockableAmount field to APIDeposit interface and getDepos…
Ayagoumi Dec 15, 2023
651e0ff
PVM: ExecutorAuth for AddressstateTx
peak3d Apr 24, 2024
21e3640
Add GetCreateAssetFee Getter
peak3d Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 14 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
module.exports = {
plugins: ['security'],
extends: ['prettier', 'plugin:security/recommended'],
plugins: ["security"],
extends: ["prettier", "plugin:security/recommended"],
parserOptions: {
project: 'tsconfig.json',
project: "tsconfig.json",
ecmaVersion: 2017,
sourceType: "module"
},
parser: '@typescript-eslint/parser',
};
parser: "@typescript-eslint/parser",
ignorePatterns: [
"**/*/*.d.ts",
"**/*/*.test.ts",
"e2etestlib.ts",
"__mocks__"
],
rules: {
"@typescript-eslint/no-explicit-any": "off"
}
}
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ updates:
directory: "/"
schedule:
interval: "weekly"
target-branch: "development"
target-branch: "dev"
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@ name: CI
on:
push:
branches:
- master
- chain4travel
- dev
pull_request:
branches:
- chain4travel
- dev
workflow_dispatch:
inputs:
caminojsRepo:
description: "caminojs github repository"
required: true
default: "chain4travel/caminojs"
caminojsBranch:
description: "caminojs branch"
required: true
default: "chain4travel"
workflow_call:

env:
CI: true
Expand All @@ -16,10 +31,20 @@ jobs:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v2
- name: Check out chain4travel/caminojs
uses: actions/checkout@v2
with:
repository: "chain4travel/caminojs"
- name: Check out ${{ github.event.inputs.caminojsRepo }} ${{ github.event.inputs.caminojsBranch }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.caminojsRepo }}
ref: ${{ github.event.inputs.caminojsBranch }}
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn prettier-check
- run: yarn test
6 changes: 2 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ development ]
branches: [chain4travel, dev]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
schedule:
- cron: "39 22 * * 5"
branches: [chain4travel, dev]

jobs:
analyze:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/e2e.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
mount_spec=$(pwd):/avalanchejs/
image=avaplatform/avalanche-testing:master
mount_spec=$(pwd):/caminojs/
image=camplatform/camino-testing:master

echo "$DOCKER_PASS" | docker login --username "$DOCKER_USERNAME" --password-stdin
custom_params_json="{
\"avalanchegoImage\":\"/avalanchejs/avalanchego/build/\",
\"testParams\": {\"avalancheJS\": { \"dir\": \"/avalanchejs/\" } },
\"executeTests\":[\"AvalancheJS\"]
\"caminogoImage\":\"/caminojs/caminogo/build/\",
\"testParams\": {\"caminoJS\": { \"dir\": \"/caminojs/\" } },
\"executeTests\":[\"CaminoJS\"]
}"

docker run -v $mount_spec $image ./local-e2e-tests.bin --custom-params-json="${custom_params_json}"
115 changes: 87 additions & 28 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,111 @@
name: E2E
on: push

on:
pull_request:
branches:
- chain4travel
- dev
workflow_dispatch:
inputs:
caminojsRepo:
description: "caminojs github repository"
required: true
default: "chain4travel/caminojs"
caminojsBranch:
description: "caminojs branch"
required: true
default: "chain4travel"
env:
GOPATH: /home/runner/go
AVAPATH: src/github.com/chain4travel
CAMPATH: src/github.com/chain4travel
ACTIONS_RUNTIME_URL:
ACTIONS_RUNTIME_TOKEN:
ACTIONS_CACHE_URL:

jobs:
e2e:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout AvalancheJS
uses: actions/checkout@v2
- name: Check out chain4travel/caminojs
uses: actions/checkout@v3
with:
repository: "chain4travel/caminojs"
- name: Check out ${{ github.event.inputs.caminojsRepo }} ${{ github.event.inputs.caminojsBranch }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v3
with:
repository: 'chain4travel/caminojs'
repository: ${{ github.event.inputs.caminojsRepo }}
ref: ${{ github.event.inputs.caminojsBranch }}
- name: Install dependencies
run: sudo apt update && sudo apt install zstd git build-essential nodejs -y
- name: Install NodeJS dependencies
run: yarn install --frozen-lockfile
- name: Setup GoLang Version
uses: actions/setup-go@v1
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Setup GOPATH and AVAPATH
run : |
mkdir -p $GOPATH/$AVAPATH
go-version: 1.19
- name: Setup GOPATH and CAMPATH
run: |
mkdir -p $GOPATH/$CAMPATH
- name: Install autoremove
run: sudo apt-get autoremove -y
- name: Clone and Build AvalancheGo
run : |
cd $GOPATH/$AVAPATH
git clone https://github.com/chain4travel/camino-node
- name: Clone and Build Camino Node
env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref || github.event.inputs.caminojsBranch }}
run: |
cd $GOPATH/$CAMPATH
git clone https://github.com/chain4travel/camino-node -b$TARGET_BRANCH
cd camino-node
./scripts/build.sh
- name: Checkout ANR
run : |
cd $GOPATH/$AVAPATH
git clone https://github.com/chain4travel/camino-network-runner
- name: Starting ANR
- name: Checkout Camino Network Runner
run: |
cd $GOPATH/$AVAPATH
cd $GOPATH/$CAMPATH
git clone https://github.com/chain4travel/camino-network-runner --depth 1
- name: Starting Camino Network Runner with Kopernikus Configuration
env:
CAMINO_NODE_PATH: ${{env.GOPATH}}/${{env.CAMPATH}}/camino-node/build/camino-node
CAMINO_NETWORK: true
run: |
cd $GOPATH/$CAMPATH
cd camino-network-runner
git checkout v0.1.4
go run ./examples/local/fivenodenetwork/main.go &
- name: AvalancheJS E2E Test
git submodule update --init --recursive
go run ./examples/local/e2enodenetwork/main.go &>/tmp/cnr-e2e.log &
- name: CaminoJS E2E Camino Tests
env:
AVALANCHEGO_IP: localhost
AVALANCHEGO_PORT: 9650
run: sleep 60 && yarn test -i --roots e2e_tests
CAMINOGO_IP: 127.0.0.1
CAMINOGO_PORT: 9650
NETWORK_ID: 1002
run: |
sleep 60
cat /tmp/cnr-e2e.log
yarn test -i --roots e2e_tests/camino
- name: Check produced logs
id: check-logs
run: |
export LOG_DIR=$(grep -Po '"log-dir": "[^"]*node1[^"]+"' /tmp/cnr-e2e.log | sed 's/"log-dir": "\(.*\)"/\1/')
grep -E 'FATAL |ERROR ' $LOG_DIR/*.log | cat > /tmp/parsed_logs
cat /tmp/parsed_logs
export errors=$(grep 'ERROR ' /tmp/parsed_logs | wc -l)
export fatal=$(grep 'FATAL' /tmp/parsed_logs | wc -l)
echo "errors=${errors}" >> $GITHUB_OUTPUT
echo "fatal=${fatal}" >> $GITHUB_OUTPUT
echo errors: ${errors}
echo fatal: ${fatal}
- name: Find Comment
uses: peter-evans/find-comment@v2
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Found errors/fatal log records."
- name: Create PR comment if errors/fatal logs produced
if: ${{ steps.check-logs.outputs.errors > 0 || steps.check-logs.outputs.fatal > 0 }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find_comment.outputs.comment-id || '' }}
edit-mode: replace
body: |
:warning: Found errors/fatal log records. Please review them(job:e2e, step:"Check produced logs") and resolve this comment.
```
${{ steps.check-logs.outputs.errors }} errors
${{ steps.check-logs.outputs.fatal }} fatal
```
28 changes: 12 additions & 16 deletions .github/workflows/njsscan-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@
name: njsscan sarif

on:
push:
branches: [ development ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ development ]
schedule:
- cron: '28 3 * * 6'
branches: [dev]

jobs:
njsscan:
runs-on: ubuntu-latest
name: njsscan code scanning
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@master
with:
args: '. --sarif --output results.sarif || true'
- name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
- name: Checkout the code
uses: actions/checkout@v2
- name: nodejsscan scan
id: njsscan
uses: ajinabraham/njsscan-action@master
with:
args: ". --sarif --output results.sarif || true"
- name: Upload njsscan report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Push to release branch

on:
push:
branches:
- chain4travel
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
name: Release
needs: [ci]
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}' >> .npmrc
- name: Install dependencies
run: yarn install
- name: Build library
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_BRANCH: chain4travel
run: yarn run semantic-release
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ docs
docsMD
tsconfig.json
.*
./*.tar
./*.tgz
*.tar
*.tgz
*.diff
e2eSequencer.js
jest.config.js
yarn.lock
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules
dist
coverage
web/
typings

*.md
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"printWidth": 100,
"htmlWhitespaceSensitivity": "ignore",
"overrides": [
{
"files": ["*.yml", "*.yaml"],
"options": {
"tabWidth": 2
}
}
]
}
Loading
Loading