35 Commits

Author SHA1 Message Date
Julian Strobl
838c887a91
Revert "Revert "Revert unnecessary config patch (#323)" (#324)" (#332)
This reverts commit b205c5ff29df25bad6b923bae327b88bdad89518.

This needs to be removed so that the parameters are read from chain.
2024-03-01 12:42:44 +01:00
Jürgen Eckel
75ed13b357
Eckelj/reducing code smell (#325)
* aggregating error messages
* removed duplicate err msgs
* removed obsolete test (two times equal behaviour )
* added global error msg module
* refactored test utils to have sample types and sample objects by keepers separated
* excluded auto-generated code from sonarcube analysis


Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 16:44:00 +01:00
Julian Strobl
b205c5ff29
Revert "Revert unnecessary config patch (#323)" (#324)
This reverts commit b1c4d11ccf3e98bd46a13d7fb54b6b5c0aefbf29.
2024-02-26 13:04:41 +01:00
Julian Strobl
b1c4d11ccf
Revert unnecessary config patch (#323)
* Revert "feat: bring back config parameters"

This reverts commit 4ab279033cae5e351cd13c348a21e4717705f341.

Unnecessary because cosmos sdk handles chain upgrades properly: it holds
the chain and waits for a new binary version.

* refactor: use testnet parameters as default in x/dao
---------

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-02-26 12:25:12 +01:00
Julian Strobl
4ab279033c feat: bring back config parameters
Needed for migration as interim solution.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-02-26 08:30:10 +01:00
Jürgen Eckel
04e45a7fb2
275 refactor feedenom on e2e test suite (#312)
* extended AttestMachine FundAccount to support a given fee denominator
* renamed testutil/network/network.go to testutil/network/loader.go
* renamed new to Load
* integrated cosmos/testutil/network to planetmint-go/testutil/network
* changed to plmnt token tests only!
* removed obsolete variables
* fixed newest linter issues

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-14 12:15:40 +01:00
Lorenz Herzberger
a38fe781ba
187 implement rddl claim (#298)
* ignite scaffold map redeem-claim amount issued:bool --module dao --index beneficiary,liquid-tx-hash

* revert: remove autogenerated delete redeem claim logic

* fix: replace deprecated autogenerated sdkerrors with errorsmod

* refactor: rename issued to confirmed on redeem claim

* feat: add claim address param

* test: add test for restricted msg UpdateRedeemClaim

* refactor: update redeem claim key creation and messages

* feat: add SendUpdateRedeemCLaim to util

* feat: add RedeemClaimDecorator for ante package

* ignite scaffold message confirm-redeem-claim id:uint beneficiary:string --module dao

* feat: add handleConfirmRedeemClaim to ante handler

* feat: add handleUpdateRedeemClaim to ante handler

* feat: implement ConfirmRedeemClaim msg handler

* test: add redeem claim test and adjust e2e test suite

* fix: make use of uint to rddl string util in CreateRedeemClaim

* fix: linter and staticcheck errors

* ignite scaffold query redeem-claim-by-liquid-tx-hash liquid-tx-hash --response redeem-claim:RedeemClaim --module dao

* feat: add RedeemClaimByLiquidTXHash store capabilities

* test: add QueryRedeemClaimByLiquidTxHash to e2e test suite

* feat: add RedeemClaimDecorator to ante handler chain

* fix: remove redundant planetmint-go from service path

* fix: linter and staticcheck errors

* fix: go vet errors

* fix: remove unused autogenerated simulation

* fix: broken simulation

* fix: openapi.yml

* revert: remove autogenerated redundant test file that causes data race on pipeline

* feat: burn claim on CreateRedeemClaim

* fix: linter error

* test: fix mock bankkeeper for msg server test

* fix: reissuance test if statement

* chore: removed TODO comment

* fix: typo in redeem claim error msg

* revert: remove autogenerated genesis state

* fix: dao module simulation

* revert: remove unused function

* fix: linter errors

* fix: linter error

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-02-01 09:57:58 +01:00
Jürgen Eckel
a29f394bc4
192 migrate config params to on chain module params (#307)
* initial refactoring commit
* added config passing to network creation for some test suits
* fixed refactoring issues
* adjusted params

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-30 16:12:04 +01:00
Jürgen Eckel
f6509cfa64
removed StakeDenom and it's related code (#299)
* removed StakeDenom and it's related code
* fixed PoP, reissuance & distribution tests

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-25 15:10:07 +01:00
Lorenz Herzberger
8d0e189593
fix: challangee rewards stay in dao module if challenge is not sucessful (#286)
* fix: challangee rewards stay in dao module if challenge is not sucessful

* refactor: split up coin conversion functions

* fix: add dao module coin conversion

* test: adjust test case for updated behavior

* chore: fix typo

* fix: do not mint claims for dao

* refactor: remove redundant statement

* fix: error handling on claim converstion fail

* fix: linter error

* chore: add comment to test case
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-18 13:56:16 +01:00
Lorenz Herzberger
6d7a5f1acb
test: fix crddl assertion on pop result e2e test (#285)
* test: fix crddl assertion on pop result e2e test

* test: replace contains with equal assertion
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-15 12:11:11 +01:00
Julian Strobl
001a472ef9
Refactoring and fixes (#272)
* refactor: switch log level for PoP messages

Needs to be the other way around, otherwise we receive up to 720
messages on info level.

* refactor: align spelling in comments and log messages

* fix: config key

Commit fc9e795bd0678746993806ac21c92a675ed7006f changed the reissuance
variable. The config key was forgotten to change.

* refactor: return early to reduce indentation

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-11 10:39:25 +01:00
Julian Strobl
7e3c0b719b
fix: distribution relative to the reissuance epoch (#270)
- reissuance   = 1 day
- distribution = 1 day + 30 min

expectation:
- reissuance:   1 day, 2 day, 3 day, ...
- distribution: 1 day + 30 min, 2 day + 30 min, 3 day + 30 min, ...

without patch:
- reissuance:   1 day, 2 day, 3 day, ...
- distribution: 1 day + 30 min, 2 day + 60 min, 3 day + 90 min, ...

Closes #260

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-11 10:27:57 +01:00
Julian Strobl
fc9e795bd0
refactor: fix casing for reissuance variable (#267)
Reissue and reissuance are standalone words and should not contain an
uppercase `I` in the variable name. This should only happen to connect
different word like: file name gets `fileName` resp. `FileName`.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-10 10:47:38 +01:00
Julian Strobl
3e23260a9c
test: refactor broadcast tx into function (#259)
Force test cases to check tx response for errors.

* refactor: improve broadcast error logging

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-05 13:43:52 +01:00
Julian Strobl
fa05ec7fff
Fix test pop result (#258)
* chore: update elements-rpc to v0.5.2

* fix: logging output in dao keeper

* refactor: properly check broadcast tx output

* fix: use correct proposer address in test

Otherwise we get an error like:
```
[app] reissue: failed. valid result: true proposer: plmnt1gyg6lxcre5f8t4ef0uxcqen9jczwalzjvc25k8
  validator identity: fb7ecaf9584dfdc67265f599155571651c149207
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-05 09:49:40 +01:00
Lorenz Herzberger
6bff8e835d
Split up e2e test suites to run separately (#256)
* refactor: Split up machine e2e test suites

* refactor: move CreateAccount and FundAccount to testutil/e2e

* refactor: add AttestMachine to testutil/e2e

* refactor: split up asset e2e test suites

* refactor: make use of testutil in e2e dao suite

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-04 07:43:01 +01:00
Julian Strobl
f957f540a1
Refactor lib (#254)
* refactor: remove unwanted function in `lib`

The `lib` shall always be used with file lock.

* refactor: log `txResponse` in `buildSignBroadcastTx`

- Move `GetTxResponseFromOut` from `testutil` to `lib`

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 10:41:09 +01:00
Jürgen Eckel
379cc761b2
adjusted re-issuance values and the corresponding test cases. (#238)
* adjusted re-issuance values and the corresponding test cases.
* [test] Fix `TestPoPResult`
* [test] Revert `TestReissuance`

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Julian Strobl <jmastr@mailbox.org>
2023-12-19 09:02:35 +01:00
Julian Strobl
036ce7cbc1
Enable sequence file locking in tests (#236)
* [lib] Add `FeeGranter` to tx factory
* [lib] Align return value with test cases
* [test] Return error on tx response
* [test] Switch to sequence file locking via libRPC
* [test] Reintegrate `TestPoPResult`

Closes #234


Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-18 15:47:44 +01:00
Julian Strobl
487dc3b93c
[test] Check TxResponse on every ExecTestCLICmd() (#235)
Just a small improvement to not forget to check the error code of the
transaction and not only from the command itself.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-15 11:32:29 +01:00
Lorenz Herzberger
0d74b81ac9
210 make distribution dependent reissuance (#216)
* distribution now requires re-issuance
* change claim conversion to use fixed uint amounts
* change initialization of util variable
* move rpc conf init to app config init


Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-15 09:39:02 +01:00
Julian Strobl
df8ece2a30
Fix TestReissuance() E2E test (#214)
* [lib] Add fee denominator parameter

* [lib] Add client context parameter

e.g. the test cases create their own client context.

* [lib] Reset client context's output

Otherwise if the client context does not change, output gets appended
and gets un-parsable.

* [test] Set missing validator client context values

Necessary for sending transactions.

* [test] Configure RPC library

* [test] Fix `TestReissuance()`

// Closes #195

* Partially revert "[lib] Provide default encoding config (#209)"

This reverts commit 8a8a3aaaf2648f87c4052575bc1a60b23056463b.

Fix README example.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-12-07 09:57:33 +01:00
Lorenz Herzberger
94830df5fc
184 implement staged claim (#190)
* adjust issuePoPRewards to mint stagedCRDDL
* add GetChallengeRange
* add resolveStagedClaims on ReissueRDDLResult msg
* move claim resolve to distribution result
* add StagedDenom and ClaimDenom to config
* added the prepare4linting.sh script
* renamed PoPEpochs to PopEpochs
* renamed DistributionAddressPoP to DistributionAddressPop
* added config value ReIssuanceEpochs
* detached the re-issuance from the distribution process and schedule them independently
* changed logging messages
* added an explicit util/kv_serialize.go file to have all KV serialization done
* switched to Bigendian serialization of int64 to have the ordered list on the kvstore
* added ComputeReIssuanceValue to enable re-issuances once a day or defined by ReIssuanceEpoch
* integrated a ReIssuanceValue computation test case
* adjusted the challenges test cases to be epoch-dependent
* added ReIssuances per ReIssuanceEpoch
* extended the Reissue message
* checking ReIssuanceProposal in the ante handler
* added precision setter for the UINT to RDDL token converter (and test cases)
* add e2e test case for pop rewards


Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Co-authored-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-12-05 10:51:06 +01:00
Jürgen Eckel
a982abecf5
Distribute assets (#162)
* distributed & result msgs
* added DistributionResult
* added RDDL token conversion methods
* set proper validatoraddress within the testcases for e2e/dao
* set proper root dir for test cases
* fixed some wordings
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2023-11-15 13:31:20 +01:00
Lorenz Herzberger
83d493dd94
139 implement mint address param (#174)
* add MintAddress to params.proto

* ignite scaffold message update-params params:Params --module dao

* add dao get and set params

* make dao.MsgUpdateParams.Params non-nullable

* use GetMintAddress in ante handler

* adjust dao e2e test suit for mint address param

* change msg creator to authority and set gov module as default in gov proposal

* fix staticcheck error

* remove depricated config param

* fix linter errors

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-11-15 10:46:01 +01:00
Lorenz Herzberger
7a3ccccc7a
119 create dao msg to mint plmnt on demand (#122)
* add mint address to config file
* ignite scaffold type mint-request beneficiary amount liquid-tx-hash --module dao
* add mintrequest stores
* rename mint_request.go
* add unit tests for mint request store
* ignite scaffold message mint-token mint-request:MintRequest --module dao
* add ante handler for mint address
* add msg validation for mint request
* fix staticcheck error
* ignite scaffold query get-mint-requests-by-hash hash --response mint-request:MintRequest --module dao
* add a query for mint request and additional validation for msg server
* add mock for mint unit testing
* add unit test for mint token msg server
* add unit tests for query mint requests by hash
* ignite scaffold query mint-requests-by-address address --response mint-requests:MintRequests --module dao
* implement query mint requests by address and unit tests
* add e2e test for token mint

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-10-05 15:38:53 +02:00
Lorenz Herzberger
7c31fb1d68
fix fee deduction, distribution test case (#117)
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-10-03 13:27:11 +02:00
Lorenz Herzberger
94022e1102
100 set fees to be 1 plmnt for a tx (#114)
* replace DeductFeeDecorator and adjust e2e tests
* reorganize decorators and add comments

---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-10-03 09:01:39 +02:00
Julian Strobl
d4eed021c8
[go.mod] Switch module to github.com (#86)
This is the quasi-standard and fixes the error below:

```
$ go get -u github.com/planetmint/planetmint-go@v0.1.0
go: github.com/planetmint/planetmint-go@v0.1.0: parsing go.mod:
        module declares its path as: planetmint-go
                but was required as: github.com/planetmint/planetmint-go
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2023-09-21 17:37:57 +02:00
Lorenz Herzberger
58c7947045
fix lint errors
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-05 12:34:35 +02:00
Lorenz Herzberger
6283299d94
sanitize test case
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-05 12:12:10 +02:00
Lorenz Herzberger
c58dda2034
add denoms to config
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-09-05 11:03:42 +02:00
Lorenz Herzberger
05a484c8b9
implement e2e test scenario for fee distribution
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-08-31 16:33:22 +02:00
Lorenz Herzberger
f9de021deb
added EndBlocker and started implementing e2e test suite
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2023-08-28 17:24:00 +02:00