331 Commits

Author SHA1 Message Date
Jürgen Eckel
ce38030755
added PreviousAppHash to the x/dao params. Thus enabling notarzation of the app hash of a previous chain state
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-27 17:20:04 +01:00
Jürgen Eckel
55b7065744
Eckelj/remove the smell (#326)
* removed some more code smell/error message aggregation
* removed obsolete/duplicate tests/code
* excluded TODOs (simulation) from being processed by sonarqube
* removed TODO code

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 18:06:43 +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.
v0.8.0
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
Jürgen Eckel
ec697840de
Eckelj/machine update params (#322)
* added signing authority (dao) to the keeper to enable dao signing checks
* added UpdateParam message for the machine module

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-26 12:00:37 +01:00
Julian Strobl
412e15449b feat: add migration to v0.8.0
Take x/dao and x/machine default parameters and store them into the
respective module state.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-02-26 08:30:10 +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
Lorenz Herzberger
373b2aeab6
docs: shorten readme to development parts only (#314)
* docs: shorten readme to development parts only

* docs: add discord link to readme

* docs: add link REPs
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-02-15 16:09:43 +01:00
Jürgen Eckel
951d854891
311 review test case ssendpopresultoutbytes true todo bug (#313)
* added PoP report validation to the ReportPoPResult msg server
* removed two obsolete pop report deliveries
* added challenger is the PoPreport msg creator (new restriction)
* extended msg server test cases

---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-15 14:41:05 +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
Jürgen Eckel
f6a7a56704
* added default params for x/machine/params (#310)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-01 15:24:41 +01:00
Jürgen Eckel
373614e1b2
269 set a chain wide upper gas limit for transactions (#309)
* set global tx gas limit
* extend lib/tx to process multiple messages
* extend lib/tx to configure tx gas limit
* added global gas limit tests
* increased account funding to support needs of testcases

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-02-01 10:23:38 +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
Julian Strobl
df264421b4
chore: bump lib version to v0.4.1
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
lib/v0.4.1 v0.7.4
2024-01-30 12:15:58 +01:00
Julian Strobl
23648927c3
feat: put sequence files into sub-directory (#308)
- aligns the folder structure in `planetmint-go/`
- makes sequence number clean up via systemd possible

// see https://github.com/rddl-network/issues/issues/61

* refactor: open sequence file into function
* refactor: get sequence number into utils

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-30 12:13:05 +01:00
Jürgen Eckel
bfbe9584a1
296 change distribution (#306)
* updated planetmint-go dependency in lib/tx
* added two additional distribution addresses. splitted up the previous investor pool of 31% into three pools:
* early investors 19%
* investors 10%
* strategic 2%

* adjusted distribution request message
* adjusted distribution result
* adjusted distribution order
* refactored reissuance and distribution msg methods to be more readable

* fixed token distribution test case

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-29 14:33:40 +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
Jürgen Eckel
2a9d3d4b47
lazy loading of config.GetConfig calls (#293)
* the execution of Config code is not determinitic within init methods. That's why we apply lazy loading.

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.7.3
2024-01-22 11:03:11 +01:00
Jürgen Eckel
7aa0c7f6cc
fixed decision-making bug within SendMqttPopInitMessagesToServer from last releaes (#292)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.7.2
2024-01-19 11:17:47 +01:00
Jürgen Eckel
8ba6b20357
removed 2nd init() method that caused behaviour during testing and real execution (#291)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
2024-01-19 10:26:57 +01:00
Julian Strobl
0e0637a04b
fix: refactor forgotten asset endpoints (#290)
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-18 14:36:21 +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
Julian Strobl
cb230f1615
refactor: cli queries (#288)
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-18 12:06:21 +01:00
Jürgen Eckel
5d3cd51ba3
281 implement pop corner cases (#282)
* ensure PoP is always initialized even without a defined challenger and challengee
* send the MQTT PoPInit if challenger and challengee are defined
* store the challenge in any case without regarding the minting of the rewards
* structured the added test and their staging
* fixed SelectPopParticipants bug
* restore the previous pop epoch after running dao/suite.go
* avoid popInit during machine attestations (within test cases)
---------

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
v0.7.1
2024-01-17 15:37:38 +01:00
Julian Strobl
ee4089f847
Remove planetmint-go from API endpoints (#287)
* feat: let the ci check if there are malformed api endpoints

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-16 10:39:32 +01:00
Julian Strobl
525d6a8da6
Improve get-distribution CLI output and error handling (#279)
* refactor: rename variable

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-16 09:11:44 +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
d0e269a478
lib: bump version to v0.4.0
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
lib/v0.4.0 v0.7.0
2024-01-12 10:03:24 +01:00
Jürgen Eckel
3ca10dfff1
Verifying the availability of PoP participants (#274)
* feat: verify the availability of PoP participants

* simplified and improved logging
* added MQTT-based availability check for PoP participants
* extended MQTT mocking
* Only the block proposer will send out the MQTT messages to the pop participants
* Added a configuration value for the MQTT response timeout
* removed parallel execution of one test case
* added r/w locking to the MQTT response processing
* set MQTT timeout unit to ms

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-12 10:02:09 +01:00
Julian Strobl
986685d8db
test: add e2e test for asset distribution (#276)
Closes #164

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-11 16:56:35 +01:00
Lorenz Herzberger
461891cde8
refactor: remove duplicate test scenarios (#278)
* refactor: remove duplicate test scenarios

* chore: remove deprecated rest testutil
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-11 15:59:53 +01:00
Lorenz Herzberger
2534828fc6
feature: add ante handler to block non validators from sending restri… (#273)
* feature: add ante handler to block non validators from sending restricted txs

* fix: add missing msg types and linter errors

* fix: staticcheck error

* refactor: use fallthrough on ante handle switch

* fix: set val address on machine attest test
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-11 14:33:20 +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
Lorenz Herzberger
4042968dff
Add gaskv ante decorator (#268)
* feature: add gaskv ante handler

* test: add test case for gaskv consumption

* chore: fix typo

* test: split up consumption test cases

* test: replace contains with equal

* fix: linter error
---------

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
2024-01-10 16:49:48 +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
2cf9bd4c43
refactor: replace raw tx by command in reissuance (#266)
In the beginning we wanted to send the raw transaction to elements, but
what we ended up doing is to send the command like:
```
"reissueasset assetID amount"
```
to elements-cli/elements-rpc.

Closes #226

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-10 10:30:58 +01:00
Julian Strobl
094f547e7a
fix: app logger formatting (#265)
From this:
```
ERR [app] reissue: failed. valid result: %v proposer: %s validator
identity: %s module=server
```
to this:
```
ERR [app] reissue: failed. valid result: true proposer:
9d3b2072f96f9481de983700605fbcd9158d5b63 validator identity:
31615187759d4bdb1c43ea7e7b9be91066042fbf module=server
```

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 16:55:33 +01:00
Julian Strobl
25649be550
fix: remove check from machine attestation request (#264)
`k.isNFTCreationRequest(msg.Machine)` was removed as it became obsolete
and we are not issuing generic tokens from within the machine
attestation process.

Closes #242

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 10:25:50 +01:00
Julian Strobl
6d05f85cbd
Use lib in rest e2e machine test (#263)
* refactor: align variable name with rest of the code

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-09 10:14:54 +01:00
Julian Strobl
ae161f11e5
refactor: let lib set client context's address and name (#261)
* fix: make a real copy of bytes.Buffer

* refactor: rename `address` for maximum clarity in lib

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-08 16:04:42 +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
Julian Strobl
4599bc2c78
refactor: improve logging (#257)
* refactor: improve logging

- Introduce logger tags
- Log variable contents
- Fix testing logger to support string formatting

* refactor: set logging context

And move logging into function.

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-04 12:50:34 +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
99031fb857
lib: add initial e2e tests (#255)
* fix: only increase counter if broadcast was successful

Otherwise we will get account and sequence numbers mismatches.

* test: add initial e2e tests for `lib/`

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
2024-01-03 13:08:13 +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
dependabot[bot]
3ca729c15b
Bump github.com/dvsekhvalnov/jose2go from 1.5.0 to 1.6.0 in /lib (#252)
Bumps [github.com/dvsekhvalnov/jose2go](https://github.com/dvsekhvalnov/jose2go) from 1.5.0 to 1.6.0.
- [Commits](https://github.com/dvsekhvalnov/jose2go/compare/v1.5...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/dvsekhvalnov/jose2go
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-03 10:36:49 +01:00