`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>
* Split asset registry endpoint
Into scheme, domain and path. We need the domain in the liquid contract.
* Switch to pure Go implementation
This is a reimplementation of the `issue2liquid.py`.
See https://github.com/rddl-network/issuer_service
// Closes#196
* Move elements RPC URL into config
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* removed error throwing within the AttestMachine method
* add more extensive logging around that call
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* 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>
* 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>
* Fix liuqid notarization (#191)
* Fix liuqid notarization - 2nd part (#193)
* fixed missing unmarshaling
* fixed message formatting issue
* fixed config parsing issue (#194)
* [util] Supply fees
But only where we want to see the transaction succeed. The other ones we
let in a broken state.
* Added logger a logger struct to log with a TAG (#198)
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Co-authored-by: Jürgen Eckel <eckelj@users.noreply.github.com>
* [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>
* [linter] Remove unused exclusions
Linter `nosnakecase` was removed in 1e1138d0268a9896a1bd058e9b65b808eb20666e.
* [linter] Add tool for code clone detection
* [linter] Add `errorlint`
Find code that will cause problems with the error wrapping scheme
introduced in Go 1.13.
* [linter] Add `exhaustive`
Check exhaustiveness of enum switch statements.
* [linter] Add `forcetypeassert`
Finds type assertions which did forcely such as below:
```
func f() {
var a interface{}
_ = a.(int) // type assertion must be checked
}
```
* [linter] Add `gocritic`
Provides diagnostics that check for bugs, performance and style issues.
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
Golang uses:
- Camel Case for variable names, e.g. `firstName`
- Camel Case for private function names, e.g. `getFirstName`
- Pascal Case for public function names, e.g. `GetFirstName`
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* hotfix: inconsistent logging of block-proposer results on the chain. These results need to be consensed via an explicit message instead of an error output.
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
* initial asset notarization restructuring
* adjusted test cases, two are still failing
* removed obsolete data structures
---------
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
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>
* added upper and lower case TA resolution testing
* added more detailed error reporting to the ValidateSignature method.
* extended test cases to test and verify these errs and their differences
* fixed CID attestation issue. CIDs are send in web compatible encoding that is not hex encoded and can be utilized without any further decoding on the server side.
* added checks and error handling for the Ta store object storage/loading
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
Up to know we just use the Bitcoin mainnet parameters
`chaincfg.MainNetParams` for Liquid. That's okay, because we use them
for creating and verifying extended private and public keys. Those only
depend on `HDPrivateKeyID` and `HDPublicKeyID`, which are the same for
Bitcoin and Liquid networks.
The only real difference is the `HDCoinType` used for key derivation,
which we want to use in the future. So it is a good idea to introduce
this value now.
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* Fix package and domain name
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* Add extended public key as `IssuerPlanetmint`
This patch introduces parts of the `chaincfg` for Planetmint and
especially the magic bytes that produces extended keys with the prefix
`pmpr` for a Planetmint extended private key and `pmpb` for a Planetmint
extended public key.
// Closes https://github.com/rddl-network/issues/issues/30
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* Validate Planetmint extended public key during machine attestation
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* [lint] Fix error return value is not checked
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
---------
Signed-off-by: Julian Strobl <jmastr@mailbox.org>
* added OSC response listener with logging
added Machine NFT issuance for each machine attestation process
added CID and Planetmint Issuer extPublicKey to the issuance process
removed type inconsistency
* added machine NFT creation criteria
* [toml] Parsing does not allow sub-structs
* made OSC listener port configurable
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>
This patch extends `app.toml` and adds the following section with these
default values:
```
[planetmint]
watchmen-endpoint = "localhost"
watchmen-port = 7401
```
A global singleton `plmntConfig` is introduced to save and access the
values similar to how cosmos does it (see
vendor/github.com/cosmos/cosmos-sdk/types/config.go).
Different environments can be managed by changing the values in
`app.toml` and restarting the daemon.
// Closes#53
Signed-off-by: Julian Strobl <jmastr@mailbox.org>