Skip to content

Commit

Permalink
Merge pull request #351 from multiversx/feat/next
Browse files Browse the repository at this point in the history
Merge feat/next(v9) into main
  • Loading branch information
popenta authored Nov 22, 2023
2 parents 9e6f330 + 53f4ae4 commit 46da74d
Show file tree
Hide file tree
Showing 59 changed files with 801 additions and 1,378 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,54 @@ name: build

on:
pull_request:
branches: [ main, feat/* ]
branches: [main, feat/*]
workflow_dispatch:

jobs:
build:
name: Build and Test mxpy for ${{ matrix.os }}, python ${{ matrix.python-version }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-2019]
python-version: [3.8]
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pytest
- name: Set github_api_token
shell: bash
run: |
mkdir ~/multiversx-sdk
export PYTHONPATH=.
python3 -m multiversx_sdk_cli.cli config new test
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }}
- name: Setup test dependencies
shell: bash
run: |
python3 -m multiversx_sdk_cli.cli deps install testwallets
- name: Run unit tests
shell: bash
run: |
export PYTHONPATH=.
pytest -m "not skip_on_windows" .
- name: Run CLI tests
shell: bash
run: |
export PROXY=https://testnet-gateway.multiversx.com
export CHAIN_ID=T
cd ./multiversx_sdk_cli/tests
source ./test_cli_tx.sh && testAll || return 1
source ./test_cli_dns.sh && testOffline || return 1
source ./test_cli_validators.sh && testAll || return 1
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
shell: bash
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pytest
- name: Set github_api_token
shell: bash
run: |
mkdir ~/multiversx-sdk
export PYTHONPATH=.
python3 -m multiversx_sdk_cli.cli config new test
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }}
- name: Setup test dependencies
shell: bash
run: |
python3 -m multiversx_sdk_cli.cli deps install testwallets
- name: Run unit tests
shell: bash
run: |
export PYTHONPATH=.
pytest -m "not skip_on_windows" .
- name: Run CLI tests
shell: bash
run: |
export PROXY=https://testnet-gateway.multiversx.com
export CHAIN_ID=T
cd ./multiversx_sdk_cli/tests
source ./test_cli_tx.sh && testAll || return 1
source ./test_cli_dns.sh && testOffline || return 1
source ./test_cli_validators.sh && testAll || return 1
75 changes: 37 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,52 @@ name: build

on:
pull_request:
branches: [ main, feat/* ]
branches: [main, feat/*]
workflow_dispatch:

jobs:
build:
name: Build and Test mxpy for ${{ matrix.os }}, python ${{ matrix.python-version }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.11]
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pytest
- name: Install libtinfo5
if: ${{ matrix.os != 'macos-latest' }}
run: |
sudo apt update
sudo apt install -y libtinfo5
- name: Set github_api_token
run: |
mkdir ~/multiversx-sdk
export PYTHONPATH=.
python3 -m multiversx_sdk_cli.cli config new test
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }}
- name: Setup test dependencies
run: |
python3 -m multiversx_sdk_cli.cli deps install testwallets
python3 -m multiversx_sdk_cli.cli deps install wasm-opt
- name: Run unit tests
run: |
export PYTHONPATH=.
pytest .
- name: Run CLI tests
run: |
python3 -m multiversx_sdk_cli.cli config set dependencies.vmtools.tag v1.4.60
cd ./multiversx_sdk_cli/tests
source ./test_cli_contracts.sh && testAll || return 1
source ./test_cli_dns.sh && testOffline || return 1
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
pip3 install pytest
- name: Install libtinfo5
if: ${{ matrix.os != 'macos-latest' }}
run: |
sudo apt update
sudo apt install -y libtinfo5
- name: Set github_api_token
run: |
mkdir ~/multiversx-sdk
export PYTHONPATH=.
python3 -m multiversx_sdk_cli.cli config new test
python3 -m multiversx_sdk_cli.cli config set github_api_token ${{ secrets.GITHUB_TOKEN }}
- name: Setup test dependencies
run: |
python3 -m multiversx_sdk_cli.cli deps install testwallets
- name: Run unit tests
run: |
export PYTHONPATH=.
pytest .
- name: Run CLI tests
run: |
python3 -m multiversx_sdk_cli.cli config set dependencies.vmtools.tag v1.4.60
cd ./multiversx_sdk_cli/tests
source ./test_cli_contracts.sh && testAll || return 1
source ./test_cli_dns.sh && testOffline || return 1
4 changes: 2 additions & 2 deletions .github/workflows/install-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
workflow_dispatch:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
install:
runs-on: macos-latest

strategy:
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
workflow_dispatch:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
install:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/install-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
workflow_dispatch:

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
install:
runs-on: windows-2019

strategy:
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ venv.bak/

# Typings
typings

multiversx_sdk_cli/tests/testdata-out
74 changes: 55 additions & 19 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ COMMANDS summary
----------------
new Create a new Smart Contract project based on a template.
templates List the available Smart Contract templates.
build Build a Smart Contract project using the appropriate buildchain.
build Build a Smart Contract project.
clean Clean a Smart Contract project.
test Run scenarios (tests).
report Print a detailed report of the smart contracts.
Expand All @@ -85,13 +85,12 @@ usage: mxpy contract new [-h] ...
Create a new Smart Contract project based on a template.
positional arguments:
name
options:
-h, --help show this help message and exit
--template TEMPLATE the template to use
--directory DIRECTORY 🗀 the parent directory of the project (default: current directory)
-h, --help show this help message and exit
--name NAME The name of the contract. If missing, the name of the template will be used.
--template TEMPLATE the template to use
--tag TAG the framework version on which the contract should be created
--path PATH the parent directory of the project (default: current directory)
```
### Contract.Templates
Expand All @@ -105,6 +104,7 @@ List the available Smart Contract templates.
options:
-h, --help show this help message and exit
--tag TAG the sc-meta framework version referred to
```
### Contract.Build
Expand All @@ -114,7 +114,7 @@ options:
$ mxpy contract build --help
usage: mxpy contract build [-h] ...
Build a Smart Contract project using the appropriate buildchain.
Build a Smart Contract project.
options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -994,7 +994,7 @@ usage: mxpy wallet COMMAND [-h] ...
Create wallet, derive secret key from mnemonic, bech32 address helpers etc.
COMMANDS:
{new,convert,bech32}
{new,convert,bech32,sign-message,verify-message}
OPTIONS:
-h, --help show this help message and exit
Expand All @@ -1005,6 +1005,8 @@ COMMANDS summary
new Create a new wallet and print its mnemonic; optionally save as password-protected JSON (recommended) or PEM (not recommended)
convert Convert a wallet from one format to another
bech32 Helper for encoding and decoding bech32 addresses
sign-message Sign a message
verify-message Verify a previously signed message
```
### Wallet.New
Expand Down Expand Up @@ -1041,7 +1043,7 @@ options:
--outfile OUTFILE path to the output file
--in-format {raw-mnemonic,keystore-mnemonic,keystore-secret-key,pem}
the format of the input file
--out-format {raw-mnemonic,keystore-mnemonic,keystore-secret-key,pem}
--out-format {raw-mnemonic,keystore-mnemonic,keystore-secret-key,pem,address-bech32,address-hex}
the format of the output file
--address-index ADDRESS_INDEX the address index, if input format is raw-mnemonic, keystore-mnemonic
or pem (with multiple entries) and the output format is keystore-
Expand All @@ -1067,6 +1069,44 @@ options:
--encode whether to encode
--decode whether to decode
```
### Wallet.SignMessage


```
$ mxpy wallet sign-message --help
usage: mxpy wallet sign-message [-h] ...
Sign a message
options:
-h, --help show this help message and exit
--message MESSAGE the message you want to sign
--pem PEM 🔑 the PEM file, if keyfile not provided
--pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0)
--keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided
--passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided
--ledger 🔐 bool flag for signing transaction using ledger
--ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger
--ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger
--sender-username SENDER_USERNAME 🖄 the username of the sender
```
### Wallet.VerifyMessage


```
$ mxpy wallet verify-message --help
usage: mxpy wallet verify-message [-h] ...
Verify a previously signed message
options:
-h, --help show this help message and exit
--address ADDRESS the bech32 address of the signer
--message MESSAGE the previously signed message(readable text, as it was signed)
--signature SIGNATURE the signature in hex format
```
## Group **Localnet**

Expand Down Expand Up @@ -1217,13 +1257,11 @@ usage: mxpy deps install [-h] ...
Install dependencies or multiversx-sdk modules.
positional arguments:
{all,llvm,clang,cpp,rust,golang,vmtools,mx_chain_go,mx_chain_proxy_go,wasm-opt,twiggy,testwallets}
the dependency to install
{all,rust,golang,vmtools,testwallets} the dependency to install
options:
-h, --help show this help message and exit
--overwrite whether to overwrite an existing installation
--tag TAG the tag or version to install
-h, --help show this help message and exit
--overwrite whether to overwrite an existing installation
```
### Dependencies.Check
Expand All @@ -1236,12 +1274,10 @@ usage: mxpy deps check [-h] ...
Check whether a dependency is installed.
positional arguments:
{all,llvm,clang,cpp,rust,golang,vmtools,mx_chain_go,mx_chain_proxy_go,wasm-opt,twiggy,testwallets}
the dependency to check
{all,rust,golang,vmtools,testwallets} the dependency to check
options:
-h, --help show this help message and exit
--tag TAG the tag or version to check
-h, --help show this help message and exit
```
## Group **Configuration**
Expand Down
Loading

0 comments on commit 46da74d

Please sign in to comment.