* no fee deduction in case of machineattestation messages
* no gas price for machineattestations in lib/tx
* test: add balance check to machine attestation e2e test
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
* Added more sync objects to avoid accidental data races
* made lib.config.Config variables are private, so they cannot be tampered with (multithreading).
Please introduce Get-methods to retrieve the varialbes outside of the package if you need it.
This way, the race conditions and unexpected change of the global object state can be protected
* added reverse takedown of the validators to avoid the following error
[app] PoP broadcast tx failed: node0.info: key not found
* moved util.TerminationWaitGroup.Wait()
to the central network cleanup method
* removed mappings for private variables
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* added TermintionWaitGroup
* added mutex to lib/tx
* removed machine attestation thread (to comply with testing-race conditions becoming apparent on the CI)
* renamed test suites to have a clear naming structure
* removed parallel-testing from e2e machine test suite
* improved test suite logging
* removed parallel tests of machine_nft_tests - this caused data races due to the mock overwrites
* reduced error check to "out of gas" due to multi-threading and locking delays that result in different gas consumptions
* Added waiting blocks to pass the CI
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* 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>
- 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>
* 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>
* 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>
* 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>
* removed error handling from util/issue_command.go methods
* integrated the complete error handling with context into util/issue_command.go: buildSignBroadcastTx
* setting the chainID of lib/tx dynamically
* removed obsolete timeout
* removed obsolete TODO message
* improved logging information and clarity of information
* improved readability and debugability of BroadcastTxWithFileLock
* fixed getClientContext bug for chains different from the testnet by removing a hard-coded value
* renamed setConfig to setRPCConfig
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* [lib] Refactor `getClientContextAndTxFactory()`
So that we can pass the account number and sequence number from
outside.
* [lib] Add `BroadcastTxWithFileLock()`
This implements "offline mode" via RPC, but instead of keeping track of
the sequence numbers, we write them into a file and lock them. This way, we can synchronize multiple processes using the same address, trying to
send transactions simultaneously.
// Closes https://github.com/rddl-network/issues/issues/46
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* [lib] Introduce variable for error
* [lib] Improve error handling in `broadcastTx()`
* Use `BroadcastTxWithFileLock()`
// See https://github.com/rddl-network/issues/issues/46
---------
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* [tests] Avoid potential data races
* Revert "[lib] Switch from RPC (REST) to gRPC (#183)"
This reverts commit db5f4fb3fe6899bcfdadf3471f826a6a97035440.
* [lib] DRY: Use build and broadcast tx from cosmos-sdk
This is in preparation for: https://github.com/rddl-network/issues/issues/46
Without this patch broadcasting a transaction in "offline mode" (setting
the sequence number manually) would not work consistently. Every so
often the endpoint would report back, that it got an unexpected sequence
number. Executing the request with the same sequence number couple of
seconds later would be successful.
I decided to better use the same source code, that the CLI uses, because
I know that offline mode works there.
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* [linter] Add `musttag`
Enforce field tags in (un)marshaled structs.
* [linter] Add `nestif`
Reports deeply nested if statements.
* [linter] Add `noctx`
Finds sending http request without context.Context.
* [linter] Add `paralleltest`
Paralleltest detects missing usage of t.Parallel() method in your Go
test.
* [linter] Add `tagalign`
Check that struct tags are well aligned.
* [linter] Add `tagliatelle`
Checks the struct tags.
* [linter] Add `whitespace`
Tool for detection of leading and trailing whitespace.
* [paralleltest] Exclude files bc of data race in tests
Signed-off-by: Julian Strobl <jmastr@mailbox.org>