Skip to content

Commit

Permalink
Develop (#60)
Browse files Browse the repository at this point in the history
* Feat scenario checkpoint (#50)

* fix: skip confirmation CLI command

* refacto: use black for formatting

* feat: handle checkpoints deletion

* feat: add create, load and delete command for scenario

* docs: fix wrong args

* docs: add explanation for scenario checkpoints and update changelog

* fix: idiom condition

* fix: empty version number in CI

* Bump version: 1.1.0 → 1.1.1-dev0

* fix: fetch all PR commits instead of the last one

* Bump version: 1.1.1-dev0 → 1.1.1-dev1

* fix: use logger and add echo statements, allow autobump to be run manually

* Bump version: 1.1.1-dev1 → 1.1.1-dev2

* fix: depth fetch for checkout

* Bump version: 1.1.1-dev2 → 1.2.0-dev0

---------

Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Feat upgrade step (#51)

* feat: add upgrade step

* tests: add tests for the upgrade step

* docs: add upgrade step documentation and changelog

* logs: add and fix log messages

* Bump version: 1.2.0-dev0 → 1.2.0-dev1

---------

Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Feat libs upgrade (#52)

* fix: replace deprecated use of pkg_resources

* feat: upgrade requirements versions

* fix: adapt to the changes of the Address class

* fix: adapt to the changes of the Account classe

* fix: add the new transaction arguments

* fix: replace is_completed test when None

* fix: detect pylint error before pylint score

* feat: add retry on query results

* fix: use completion endpoint for the on chain tx fetching

* fix: use the new Address error

* feat: add the config value for max query attempts

* test: add tests for retrieving the contract instance and address

* fix: pep8 and linting

* fix: remove deprecated script

* doc: update changelog

* Bump version: 1.2.0-dev1 → 1.2.0-dev2

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Refactor builder (#53)

* feat: upgrade to python 3.11 and fix deprecated usage

* fix: deprecated resources module

* feat: add a transaction builder class

* breaking change: use checks for all transaction steps

* breaking change: use checks for mint steps

* fix: specify tests folder

* Bump version: 1.2.0-dev2 → 2.0.0-dev0

* doc: update changelog

* fix: update python version for github CI

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Feat python step (#54)

* feat: add python step class and test

* feat: save query results within the instance

* doc: add documentation for the python step

* doc: add the new python step doc page

* doc: update changelog

* Bump version: 2.0.0-dev0 → 2.0.0-dev1

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Fix token issue properties (#55)

* fix: remove wrong arguments for issuance of non fungible tokens

* fix: remove wrong arguments from issue builders

* feat: add python check for integration tests and reorganise properties tests

* fix: use the correct default values for token properties

* fix: add missing black requirement and fix style

* docs: update changelog

* Bump version: 2.0.0-dev1 → 2.0.0-dev2

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Refactor data storage (#56)

* feat: add the possibility for nested saved values

* fix: linting

* breaking change: use full value key for Scenario data and add scenario saved values

* fix: wrong exception catched

* docs: update changelog

* Bump version: 2.0.0-dev2 → 2.0.0-dev3

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Refactor query number (#57)

* refactor: `int` is preferred over `number` for query return type

* docs: update changelog

* Bump version: 2.0.0-dev3 → 2.0.0-dev4

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Feat scene step (#58)

* feat: add SceneStep

* feat: use SceneStep in integration tests

* docs: add SceneStep documentation

* docs: add an quick overview example in the Readme

* docs: update changelog

* Bump version: 2.0.0-dev4 → 2.0.0-dev5

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Feat analyse (#59)

* docs: rephrase some sentences

* breaking change: rename data module into execution_data

* docs: update changelog

* fix: docstrings

* feat: add data path for the transactions files

* feat: add transaction data class and transaction data fetching

* feat: add agglomeration and plot for analysis

* typo: rename analyse into analyze

* feat: add cli for analyze and docs

* docs: update changelog

* docs: mention the extension

* Bump version: 2.0.0-dev5 → 2.0.0-dev6

---------

Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>

* Bump version: 2.0.0-dev6 → 2.0.0

* bump changelog: Unreleased -> 2.0.0

---------

Co-authored-by: github-actions <41898282+github-actions@users.noreply.github.com>
Co-authored-by: Etienne Wallet <116115319+EtienneWallet@users.noreplygithub.com>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent d989bdf commit ef36214
Show file tree
Hide file tree
Showing 99 changed files with 4,499 additions and 2,557 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/auto-bump.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,66 @@
name: auto-bump
on:
on:
pull_request:
branches:
- develop
- main
types:
- opened
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- info
- warning
- debug

jobs:
auto-bump:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bump2version
- name: Setup Git
run: |
git config user.email "41898282+github-actions@users.noreply.github.com"
git config user.name "github-actions"
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
- name : Auto bump version
- name: Auto bump version
run: |
VERSION=$(bump2version --dry-run --list patch | grep current_version | sed -E 's/.*=//')
PR_NUM=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
COMMITS=$(git log --pretty=format:%s ${{ github.event.pull_request.base.ref }}..${{ github.head_ref }})
BASE_SHA=${{ github.event.pull_request.base.sha }}
echo "Base SHA: $BASE_SHA"
HEAD_SHA=${{ github.event.pull_request.head.sha }}
echo "Head SHA: $HEAD_SHA"
COMMITS=$(git log --pretty=format:%s $BASE_SHA..$HEAD_SHA)
echo "Commits: $COMMITS"
python scripts/auto_bump.py ${{ github.event.pull_request.base.ref }} "$VERSION" "$COMMITS"
git push
- name : Update changelog if targeting main branch
- name: Update changelog if targeting main branch
if: ${{ github.event.pull_request.base.ref == 'main' }}
run: |
VERSION=$(bump2version --dry-run --list patch | grep current_version | sed -E 's/.*=//')
bash scripts/changelog_release.sh
git add docs/source/dev_documentation/changelog.md
VERSION=$(bump2version --dry-run --list patch | grep current_version | sed -E 's/.*=//')
git commit -m "bump changelog: Unreleased -> ${VERSION}"
git push
8 changes: 4 additions & 4 deletions .github/workflows/python-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
- name: Install aspell
run: sudo apt-get install -y aspell
- name: Install dependencies
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Install dependencies
run: |
Expand Down
5 changes: 0 additions & 5 deletions .pylintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.10"

sphinx:
configuration: docs/source/conf.py
Expand Down
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,48 @@ MxOps aims to be useful in these situations:
- on-chain integration tests
- contract interaction automation

For a quick overview, here's how to create a token, assign a mint role and mint tokens with MxOps:

```yaml
allowed_networks:
- devnet
- localnet

allowed_scenario:
- "alice_mint"

accounts:
- account_name: alice
pem_path: ./wallets/alice.pem

steps:
- type: FungibleIssue
sender: alice
token_name: AliceToken
token_ticker: ATK
initial_supply: 1000000000 # 1,000,000.000 ATK
num_decimals: 3
can_add_special_roles: true

- type: ManageFungibleTokenRoles
sender: alice
is_set: true # if we want to set or unset the roles below
token_identifier: "%AliceToken.identifier"
target: alice
roles:
- ESDTRoleLocalMint
- ESDTRoleLocalBurn

- type: FungibleMint
sender: alice
token_identifier: "%AliceToken.identifier"
amount: 100000000 # 100,000.000 ATK

```

## Getting Started

Heads up to the [documentation](https://mxops.readthedocs.io) to get started!
Heads up to the [documentation](https://mxops.readthedocs.io) to get started! You will find tutorials, user documentation and examples 🚀

## Contribution

Expand Down
10 changes: 10 additions & 0 deletions docs/dictionary/custom_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
api
APIs
AppDir
AppFolder
arg
backend
blockchain
blockchains
ChangeLog
Expand All @@ -10,16 +14,22 @@ customization
customizations
DevOps
env
environ
json
https
os
png
PyPI
pytest
Readthedocs
yaml
svg
str
utils
Flaticon
README
reusability
SBTS
sdk
VScode
wasm
6 changes: 5 additions & 1 deletion docs/dictionary/multiversx_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
abi
bech
BigUint
devnet
egld
Expand All @@ -9,6 +10,7 @@ elrond
esdt
ESDT
ESDTmapper
EsdtTransfer
fn
init
localnet
Expand All @@ -24,10 +26,12 @@ NFT
NFTs
OptionalValue
pem
ProxyNetworkProvider
sc
SFT
SFTs
testnet
txs
WEGLD
wrapEgld
wrapEgld
xExchange
14 changes: 14 additions & 0 deletions docs/dictionary/project_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
abc
alice
BaseToken
bob
Catenscia
changelog
ContractCall
ContractCallStep
ContractQuery
ContractQueryStep
ContractUpgrade
dev
Dev
devnet
EsdtMinter
françois
Freepik
GetBaseToken
GetPoolPrice
GetQuoteToken
github
jacques
jean
Keystore
Knop
mainnet
Maiar
msc
MxOps
mxops
MyCustomException
PiggyBank
PingAmount
PoolPrice
pylint
QuoteToken
runtime
ScenarioData
SuccessCheck
TransfersCheck
20 changes: 11 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
# -- Retrieve the version from pyproject.toml -------------------------------
this_directory = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(this_directory, '../../pyproject.toml'), encoding='utf-8') as file:
with open(
os.path.join(this_directory, "../../pyproject.toml"), encoding="utf-8"
) as file:
content = file.read()

version_pattern = r'\nversion\s*=\s*"(.*)"\n'
Expand All @@ -20,26 +22,26 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'MxOps'
copyright = '2023, Catenscia'
author = 'Catenscia'
project = "MxOps"
copyright = "2023, Catenscia"
author = "Catenscia"
release = version_string
version = version_string

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'myst_parser',
'sphinxcontrib.images',
"myst_parser",
"sphinxcontrib.images",
]

templates_path = ['_templates']
templates_path = ["_templates"]
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
27 changes: 26 additions & 1 deletion docs/source/dev_documentation/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,37 @@

## Unreleased

## 2.0.0 - 2023-10-20

### Added

- Checkpoints for `Scenario`
- `ContractUpgradeStep`
- Auto retry for empty query results
- python step class
- Value key can now of any depth for `Scenario` data
- `SceneStep`
- `analyze` module

### Changed

- 🚨 BREAKING CHANGE 🚨 `checks` attribute has been given for all `TransactionStep`, sometimes replacing `check_success`
- 🚨 BREAKING CHANGE 🚨 `.` and `[]` are used instead of `%` to specify a `Scenario` value key
- 🚨 BREAKING CHANGE 🚨 `data.data.py` renamed into `data.execution_data.py`
- Upgrade MultiversX python libraries
- `int` is preferred over `number` for query return type

### Fixed

- Bug with the `skip confirmation` CLI command
- Wrong token properties set during token registration

## 1.1.0 - 2023-05-11

### Added

- CLI options to clean/delete `Scenario` data before or after execution
- `Steps` for token transfers (eGLD, fungible & non fungible)
- `Steps` for token transfers (eGLD, fungible & non fungible)
- `Steps` for token issuance, roles management and minting (fungible & non fungible)
- `TransfersCheck` to verify the transfers of a `ContractCallStep`
- Networks enumerations can be parsed by their short or full names
Expand Down
Loading

0 comments on commit ef36214

Please sign in to comment.