* Starting a refactor to cut the huge files into chunks * Fixing some lints * ibid * Mixnode and gateway bonding tests moved * All transaction test moved into submodules * Finished splitting out transactions.rs from root into submodules. * Moved mixnet params state into submodule * Recombined modules for few top-level actions * Moving mixnode bonding queries into their own file * Removed some unused imports * Got tests running again. Max limit tests not right. * Fixed tests * Started moving delegation queries into own module * Finished moving delegation queries into their own module * Cleanup * Moving query limits into relevant modules * Putting query limits back at top-level * Using prefix to make storage usage a little more explicit * Separating storage into smaller chunks * More storage refactoring * Finished moving all storage into modules * Moved all storage prefixes into relevant modules and made them not-public * Renamed the mostly-empty queries module to query_support * ibid * Fixed query support rename problems * Started to move rewards-related helpers into their own module * Started moving delegations-related helpers into their own module * Moved more code from global helpers into delegations helpers * Moved all remaining test helper code from main helpers file into test helpers * Made use of test_helpers explicit via a module rename. Also got rid of non-explicit usages * Moved mixnode storage retrieval limits into mixnodes storage module * Moved bond retrieval max limit into storage moduel * Moved more storage limits into mixnodes storage file; fixed a gateways limit test. * Added a note on gateways limits constants I'll re-use the mixnodes values, but it doesn't have to be this way. We could easily make a specific constant for gateways instaed. * Renamed "state" to GlobalContractParams * Pulled bit of test helper code up a level * Small cleanup of zero spacing in constants * Made a local helper method private * Renaming GlobalContractParams to ContractSettings and StateParams to ContractSettingsParams * ibid * Renamed contract settings storage methods from "config" (which is a bit vage to "contract_settings" * Indulging a fullword as a personal protest vs the Go programming language * Renaming mixnet settings to mixnet contract settings * Making validate_mixnode_bond private and moving it downwards in the file * Moving gateway bond validation to the bottom of the tests file * Getting the wallet compiling again. * Updated TypeScript client with new types and contract method names * Updating rust validator client with new contract method names and types * Fixed type error in mixnet-contract shared msg. * Used new contract method names and types * Fixed warnings in non-test code * All tests compiling But not passing yet * Fixed test compilation warnings * Fixed tests * Test-locked Delegations struct Co-authored-by: dave <dave@nym-mbp.lan> Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
Nym Validator Client
A TypeScript client for interacting with CosmWasm smart contracts in Nym validators.
Running examples
With the code checked out, cd examples. This folder contains runnable example code that will set up a blockchain and allow you to interact with it through the client.
Running tests
npm test
You can also trigger test execution with a test watcher. I don't have the centuries of life left to me that are needed to fight through the arcana of wiring up a working TypeScript mocha triggered execution setup, so for now my Cargo-based hack is:
cargo watch -s "cd clients/validator && npm test"
It's ugly but works fine if you have Cargo installed. TypeScript setup help happily accepted here.
Generating Documentation
You can generate docs by running npm run docs. Generated output will appear in the docs directory.
Packaging
If you're a Nym platform developer who's made changes to the client and wants to re-publish the package to NPM, here's how you do it:
- Bump the version number (use SemVer)
npm run buildnpm login(if you haven't already)npm publish