Skip to content

Commit

Permalink
Format all Markdown files for the client
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain89 committed Oct 5, 2023
1 parent 80f5375 commit 97849f8
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
25 changes: 14 additions & 11 deletions packages/libs/client/BACKGROUND.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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/
17 changes: 9 additions & 8 deletions packages/libs/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
7 changes: 5 additions & 2 deletions packages/libs/client/SCRATCHPAD.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
29 changes: 18 additions & 11 deletions packages/libs/client/TESTING.md
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion packages/libs/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 97849f8

Please sign in to comment.