From 97849f85a31e96044405e91ce4204492c5613bcd Mon Sep 17 00:00:00 2001 From: Ghislain Gabrielse Date: Thu, 5 Oct 2023 13:09:05 +0200 Subject: [PATCH] Format all Markdown files for the client --- packages/libs/client/BACKGROUND.md | 25 ++++++++++++++----------- packages/libs/client/CHANGELOG.md | 17 +++++++++-------- packages/libs/client/SCRATCHPAD.md | 7 +++++-- packages/libs/client/TESTING.md | 29 ++++++++++++++++++----------- packages/libs/client/package.json | 2 +- 5 files changed, 47 insertions(+), 33 deletions(-) diff --git a/packages/libs/client/BACKGROUND.md b/packages/libs/client/BACKGROUND.md index d03db2c25f..0c74da8787 100644 --- a/packages/libs/client/BACKGROUND.md +++ b/packages/libs/client/BACKGROUND.md @@ -10,16 +10,16 @@ blockchain. ## Building a Command A command is what you want from the blockchain, the most important part of a -command is the `code` thats just a pact code (check out the -[pact documentation](https://pact-language.readthedocs.io/en/stable/)). Even -though asking `(+ 1 1)` from the blockchain is completely a valid command but -Perhaps this is not the thing you want to pay gas for, unless you need the -consensus for the answer :). Most of the time you will call some functions from -smart contracts. For example `(coin.transfer "bob" "alice" 1.1)` calls the -transfer function form the coin contract. you even can call several functions in -one code, that lets you to define a custom logic, for example let's consider bob -wants to pay 1 KDA to alice and in contrast alice will transfer the -administration of the free.theContract to bob. the code is like that +command is the `code` thats just a pact code (check out the [pact +documentation][1]). Even though asking `(+ 1 1)` from the blockchain is +completely a valid command but Perhaps this is not the thing you want to pay gas +for, unless you need the consensus for the answer :). Most of the time you will +call some functions from smart contracts. For example +`(coin.transfer "bob" "alice" 1.1)` calls the transfer function form the coin +contract. you even can call several functions in one code, that lets you to +define a custom logic, for example let's consider bob wants to pay 1 KDA to +alice and in contrast alice will transfer the administration of the +free.theContract to bob. the code is like that ```Lisp (coin.transfer "bob" "alice" 1) @@ -77,7 +77,7 @@ The complete example of the command is like this In Pact every signer can scope their signature to some capabilities by adding them in the clist array. Based on the functions you call, you might need to add some capabilities into this list otherwise the transaction fails. you can read -[What is capability](https://pact-manual.readthedocs.io/en/latest/source/capabilities/). +[What is capability][2]. ## Signing @@ -94,3 +94,6 @@ blockchain "sigs":["sig1","sig2","sig3"] } ``` + +[1]: https://pact-language.readthedocs.io/en/stable/ +[2]: https://pact-manual.readthedocs.io/en/latest/source/capabilities/ diff --git a/packages/libs/client/CHANGELOG.md b/packages/libs/client/CHANGELOG.md index 38d5cb35d3..777691a34a 100644 --- a/packages/libs/client/CHANGELOG.md +++ b/packages/libs/client/CHANGELOG.md @@ -20,20 +20,19 @@ ### Patch Changes -- Updated dependencies [8adef240] -- Updated dependencies [242b5687] -- Updated dependencies [664140f3] - - @kadena/chainweb-node-client@0.4.4 - - @kadena/cryptography-utils@0.3.8 - - @kadena/pactjs@0.3.2 +- Updated dependencies \[8adef240] +- Updated dependencies \[242b5687] +- Updated dependencies \[664140f3] + - @kadena/chainweb-node-client\@0.4.4 + - @kadena/cryptography-utils\@0.3.8 + - @kadena/pactjs\@0.3.2 ## 1.2.0 ### Minor Changes - b8b866145: Add `createEckoWalletSign()` and `createEckoWalletQuicksign()`. - This creates a wrapper for the - [eckoWALLET API](https://docs.ecko.finance/eckodex/getting-started/eckowallet/eckowallet-api) + This creates a wrapper for the [eckoWALLET API][1] This log was last generated on Mon, 21 Aug 2023 10:31:32 GMT and should not be manually modified. @@ -287,3 +286,5 @@ Fri, 28 Oct 2022 11:53:11 GMT ### Updates - Adds launch-post + +[1]: https://docs.ecko.finance/eckodex/getting-started/eckowallet/eckowallet-api diff --git a/packages/libs/client/SCRATCHPAD.md b/packages/libs/client/SCRATCHPAD.md index 2c9e88a666..a952fc71a3 100644 --- a/packages/libs/client/SCRATCHPAD.md +++ b/packages/libs/client/SCRATCHPAD.md @@ -1,5 +1,5 @@ -- [call signature](#call-signature) -- [Typescript generated dts templates](#typescript-generated-dts-templates) +- [call signature][1] +- [Typescript generated dts templates][2] # Call interface @@ -106,3 +106,6 @@ Pactjs.modules.coin.transfer().generate(); * {"cmd":"{\"signers\":[{\"pubKey\":\"554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94\",\"clist\":[{\"name\":\"coin.TRANSFER\",\"args\":[\"k:554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94\",\"k:32ed2605d925520a8bb1f08a96ce0405179ed8ba5fdd0ae3001951bc6b84fa13\",1]}]}],\"meta\":{\"creationTime\":1659096340,\"ttl\":28800,\"chainId\":\"1\",\"gasPrice\":1.0e-6,\"gasLimit\":600,\"sender\":\"\"},\"nonce\":\"chainweaver\",\"networkId\":\"mainnet01\",\"payload\":{\"exec\":{\"code\":\"(coin.transfer \\\"k:554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94\\\" \\\"k:32ed2605d925520a8bb1f08a96ce0405179ed8ba5fdd0ae3001951bc6b84fa13\\\" 1.0)\",\"data\":null}}}","hash":"JnkmNcQGodlE3mFqOLOYAx56riVtNpWNFGWCaxLVbdY","sigs":{"554754f48b16df24b552f6832dda090642ed9658559fef9f3ee1bb4637ea7c94":}} */ ``` + +[1]: #call-signature +[2]: #typescript-generated-dts-templates diff --git a/packages/libs/client/TESTING.md b/packages/libs/client/TESTING.md index ceb69ec9b5..95896e6764 100644 --- a/packages/libs/client/TESTING.md +++ b/packages/libs/client/TESTING.md @@ -1,35 +1,42 @@ # Integration Tests -In order to ensure integration with Kadena's blockchain, the client comes with integration tests that can be run towards an instance of devnet. +In order to ensure integration with Kadena's blockchain, the client comes with +integration tests that can be run towards an instance of devnet. ## Pre-requisites -Make sure all dependencies have been installed and you've successfully built the project. For the integration tests you'll also need [docker][1]. -``` shell +Make sure all dependencies have been installed and you've successfully built the +project. For the integration tests you'll also need [docker][1]. + +```sh pnpm install pnpm run build ``` ## Unit Tests -Kadena Client uses the default code coverage profile, found [here][2]. +Kadena Client uses the default code coverage profile, found [here][2]. ## Integration Tests (with devnet) + To run integration tests against devnet it requires starting devnet and exposing -the pact endpoints at [http://localhost:8080][3]. To do this, simply execute the following command: -Always pulling will ensure you're always using the latest available version of devnet. +the pact endpoints at [http://localhost:8080][3]. To do this, simply execute the +following command: Always pulling will ensure you're always using the latest +available version of devnet. -``` shell +```sh docker run --pull=always -it --rm -p 127.0.0.1:8080:8080 -v l1:/data kadena/devnet ``` -This will start up devnet and expose the required ports. -Once devnet is up and running execute the following script to execute the integration tests. +This will start up devnet and expose the required ports. + +Once devnet is up and running execute the following script to execute the +integration tests. -``` shell +```sh pnpm run test:integration ``` + [1]: https://www.docker.com/ [2]: /packages/tools/heft-rig/jest.config.json [3]: http://localhost:8080 - diff --git a/packages/libs/client/package.json b/packages/libs/client/package.json index 7082c575c0..c9d60c979e 100644 --- a/packages/libs/client/package.json +++ b/packages/libs/client/package.json @@ -24,7 +24,7 @@ "dev:postinstall": "pnpm run pactjs:retrieve:contract; pnpm run pactjs:generate:contract", "format": "pnpm run /^format:.*/", "format:lint": "pnpm run lint:src --fix", - "format:md": "remark README.md -o --use @kadena-dev/markdown", + "format:md": "remark *.md -o --use @kadena-dev/markdown", "format:src": "prettier . --cache --write", "lint": "pnpm run /^lint:.*/", "lint:fmt": "prettier . --cache --check",