Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: markdown format #312

Merged
merged 10 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Default state for all rules
default: false
MD003:
# Heading style
style: 'atx'
MD001: true
MD018: true
MD026: true
MD034: true
MD040: true
MD042: true
MD048: true
MD051: true
# MD004: false
# MD009: false
# MD010:
# code_blocks: false
# MD013: false
# MD024: false
# MD029: false
# MD033: false
# MD037: false # breaks on latex
2 changes: 2 additions & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHANGELOG.md
docs/api/proto-docs.md
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,13 @@ format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs goimports -w -local github.com/ingenuity-build/quicksilver
.PHONY: format

mdlint:
@echo "--> Running markdown linter"
@docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md"

mdlint-fix:
@docker run -v $(PWD):/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.md" --fix

###############################################################################
### Protobuf ###
###############################################################################
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ This system spec has been found to be optimal:
4. 100Mbps bidirectional Internet connection

## Software Dependencies
1. The Go programming language - https://go.dev/
2. Git distributed version control - https://git-scm.com/
3. Docker - https://www.docker.com/get-started/
4. GNU Make - https://www.gnu.org/software/make/
1. The Go programming language - <https://go.dev/>
2. Git distributed version control - <https://git-scm.com/>
3. Docker - <https://www.docker.com/get-started/>
4. GNU Make - <https://www.gnu.org/software/make/>

Make sure that the above software is installed on your system. Follow the instructions for your particular platform or use your preferred platform package manager;

In addition install `jq` (a command line JSON processor):
In addition, install `jq` (a command line JSON processor):

- Debian based systems:
`apt-get install jq`
Expand Down Expand Up @@ -60,13 +60,11 @@ For subsequent tests run the following if you want to start with fresh state:

Quicksilver utilises code and logic that originated from other projects; as an open-source project ourselves, we believe that appropriate attribution is neccessary, in order to combat plagarism.

The following modules were lifted and reused in almost entirety from Osmosis (https://github.com/osmosis-labs/osmosis), under the terms of the Apache 2.0 License, and we are grateful for their contribution:
The following modules were lifted and reused in almost entirety from Osmosis (<https://github.com/osmosis-labs/osmosis>), under the terms of the Apache 2.0 License, and we are grateful for their contribution:

```
x/mint
x/epochs
x/tokenfactory
```
x/mint
x/epochs
x/tokenfactory

We're also using CosmWasm, developed over the course of years with lead from Confio and support from the whole of Cosmos.

2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Reporting
Please report to our security mailing list at [[email protected]](mailto:[email protected]) and we shall respond to you within 72 hours.

## Packages in scope:
## Packages in scope
* [x/airdrop](/x/airdrop)
* [x/interchainstaking](/x/interchainstaking)
* [x/mint](/x/mint)
Expand Down
34 changes: 19 additions & 15 deletions x/airdrop/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ The purpose of this module is to distribute QCK airdrops to users for engaging i

## Contents

1. [Concepts](#Concepts)
1. [State](#State)
1. [Messages](#Messages)
1. [Transactions](#Transactions)
1. [Events](#Events)
1. [Hooks](#Hooks)
1. [Queries](#Queries)
1. [Keepers](#Keepers)
1. [Parameters](#Parameters)
1. [Proposals](#Proposals)
1. [Begin Block](#Begin-Block)
1. [End Block](#End-Block)
1. [Concepts](#concepts)
1. [State](#state)
1. [Messages](#messages)
1. [Transactions](#transactions)
1. [Events](#events)
1. [Hooks](#hooks)
1. [Queries](#queries)
1. [Keepers](#keepers)
1. [Parameters](#parameters)
1. [Proposals](#proposals)
1. [Begin Block](#begin-block)
1. [End Block](#end-block)

## Concepts

Expand Down Expand Up @@ -154,7 +154,9 @@ var Status_value = map[string]int32{
### ZoneDrop

```go
KeyPrefixZoneDrop = []byte{0x01}
var (
KeyPrefixZoneDrop = []byte{0x01}
)

func GetKeyZoneDrop(chainID string) []byte {
return append(KeyPrefixZoneDrop, []byte(chainID)...)
Expand All @@ -175,7 +177,9 @@ type ZoneDrop struct {
### ClaimRecord

```go
KeyPrefixClaimRecord = []byte{0x02}
var (
KeyPrefixClaimRecord = []byte{0x02}
)

func GetKeyClaimRecord(chainID string, addr sdk.AccAddress) []byte {
return append(append(KeyPrefixClaimRecord, []byte(chainID)...), addr...)
Expand Down Expand Up @@ -422,7 +426,7 @@ type QueryClaimRecordResponse struct {

## Keepers

https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/airdrop/keeper
<https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/airdrop/keeper>

## Parameters

Expand Down
30 changes: 16 additions & 14 deletions x/claimsmanager/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ based claims utilized in other modules.

## Contents

1. [Concepts](#Concepts)
1. [State](#State)
1. [Messages](#Messages)
1. [Transactions](#Transactions)
1. [Events](#Events)
1. [Hooks](#Hooks)
1. [Queries](#Queries)
1. [Keepers](#Keepers)
1. [Parameters](#Parameters)
1. [Begin Block](#Begin-Block)
1. [End Block](#End-Block)
1. [Concepts](#concepts)
1. [State](#state)
1. [Messages](#messages)
1. [Transactions](#transactions)
1. [Events](#events)
1. [Hooks](#hooks)
1. [Queries](#queries)
1. [Keepers](#keepers)
1. [Parameters](#parameters)
1. [Begin Block](#begin-block)
1. [End Block](#end-block)

## Concepts

Expand Down Expand Up @@ -58,8 +58,10 @@ var ClaimType_value = map[string]int32{
### Claim

```go
KeyPrefixClaim = []byte{0x00}
KeyPrefixLastEpochClaim = []byte{0x01}
var (
KeyPrefixClaim = []byte{0x00}
KeyPrefixLastEpochClaim = []byte{0x01}
)

// ClaimKey returns the key for storing a given claim.
func GetGenericKeyClaim(key []byte, chainID string, address string, module ClaimType, srcChainID string) []byte {
Expand Down Expand Up @@ -195,7 +197,7 @@ type QueryClaimsResponse struct {

## Keepers

https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/claimsmanager/keeper
<https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/claimsmanager/keeper>

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion x/epochs/spec/02_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ order: 2
Epochs module keeps `EpochInfo` objects and modify the information as epochs info changes.
Epochs are initialized as part of genesis initialization, and modified on begin blockers or end blockers.

### Epoch information type
## Epoch information type

```protobuf
message EpochInfo {
Expand Down
20 changes: 10 additions & 10 deletions x/epochs/spec/04_keeper.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Epochs keeper module provides utility functions to manage epochs.
```go
// Keeper is the interface for lockup module keeper
type Keeper interface {
// GetEpochInfo returns epoch info by identifier
GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo
// SetEpochInfo set epoch info
SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo)
// DeleteEpochInfo delete epoch info
DeleteEpochInfo(ctx sdk.Context, identifier string)
// IterateEpochInfo iterate through epochs
IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool))
// Get all epoch infos
AllEpochInfos(ctx sdk.Context) []types.EpochInfo
// GetEpochInfo returns epoch info by identifier
GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo
// SetEpochInfo set epoch info
SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo)
// DeleteEpochInfo delete epoch info
DeleteEpochInfo(ctx sdk.Context, identifier string)
// IterateEpochInfo iterate through epochs
IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool))
// Get all epoch infos
AllEpochInfos(ctx sdk.Context) []types.EpochInfo
}
```
13 changes: 9 additions & 4 deletions x/epochs/spec/05_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ order: 5

## Hooks
```go
// the first block whose timestamp is after the duration is counted as the end of the epoch
AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)
// new epoch is next block of epoch end block
BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
// the first block whose timestamp is after the duration is counted as the end of the epoch
func AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) {
// ...
}

// new epoch is next block of epoch end block
func BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) {
// ...
}
```

## How modules receive hooks
Expand Down
24 changes: 12 additions & 12 deletions x/interchainquery/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ facilitate provable cross-chain queries.

## Contents

1. [Concepts](#Concepts)
1. [State](#State)
1. [Messages](#Messages)
1. [Transactions](#Transactions)
1. [Events](#Events)
1. [Hooks](#Hooks)
1. [Queries](#Queries)
1. [Keepers](#Keepers)
1. [Parameters](#Parameters)
1. [Begin Block](#Begin-Block)
1. [End Block](#End-Block)
1. [Concepts](#concepts)
1. [State](#state)
1. [Messages](#messages)
1. [Transactions](#transactions)
1. [Events](#events)
1. [Hooks](#hooks)
1. [Queries](#queries)
1. [Keepers](#keepers)
1. [Parameters](#parameters)
1. [Begin Block](#begin-block)
1. [End Block](#end-block)

## Concepts

Expand Down Expand Up @@ -152,7 +152,7 @@ type QueryRequestsResponse struct {

## Keepers

https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/interchainquery/keeper
<https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/interchainquery/keeper>

## Parameters

Expand Down
40 changes: 20 additions & 20 deletions x/interchainstaking/spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ protocol.

## Contents

1. [Concepts](#Concepts)
1. [State](#State)
1. [Messages](#Messages)
1. [Transactions](#Transactions)
1. [Proposals](#Proposals)
1. [Events](#Events)
1. [Hooks](#Hooks)
1. [Queries](#Queries)
1. [Keepers](#Keepers)
1. [Parameters](#Parameters)
1. [Begin Block](#Begin-Block)
1. [After Epoch End](#After-Epoch-End)
1. [IBC](#IBC)
1. [Concepts](#concepts)
1. [State](#state)
1. [Messages](#messages)
1. [Transactions](#transactions)
1. [Proposals](#proposals)
1. [Events](#events)
1. [Hooks](#hooks)
1. [Queries](#queries)
1. [Keepers](#keepers)
1. [Parameters](#parameters)
1. [Begin Block](#begin-block)
1. [After Epoch End](#after-epoch-end)
1. [IBC](#ibc)

## Concepts

Expand Down Expand Up @@ -673,7 +673,7 @@ Query deposit account address for a given chain.

## Keepers

https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/interchainstaking/keeper
<https://pkg.go.dev/github.com/ingenuity-build/quicksilver/x/interchainstaking/keeper>

## Parameters

Expand Down Expand Up @@ -755,7 +755,7 @@ updated.

Triggered by `RequestRedemption` when a user redeems qAssets. Withdrawal
records are set or updated accordingly.
See [MsgRequestRedemption](#MsgRequestRedemption).
See [MsgRequestRedemption](#msgrequestredemption).

- **Endpoint:** `/cosmos.staking.v1beta1.MsgTokenizeShares`
- **Handler:** `HandleTokenizedShares`
Expand All @@ -779,7 +779,7 @@ Triggered at the end of every epoch during `Rebalance`.
#### MsgSend

Triggered by `TransferToDelegate` during `HandleReceiptTransaction`.
See [Deposit Interval](#Deposit-Interval).
See [Deposit Interval](#deposit-interval).

- **Endpoint:** `/cosmos.bank.v1beta1.MsgSend`
- **Handler:** `HandleCompleteSend`
Expand Down Expand Up @@ -811,7 +811,7 @@ latency and different zone block times, etc).
Triggered by `DistributeRewardsFromWithdrawAccount` to distribute rewards
across the zone delegation accounts and collect fees to the module fee account.
The `RedemptionRate` is updated accordingly.
See [WithdrawalAddress Balances](#WithdrawalAddress-Balances).
See [WithdrawalAddress Balances](#withdrawaladdress-balances).

- **Endpoint:** `/ibc.applications.transfer.v1.MsgTransfer`
- **Handler:** `HandleMsgTransfer`
Expand All @@ -833,23 +833,23 @@ update the individual account balances `AccountBalanceCallback`, trigger the
#### Delegator Delegations

Query delegator delegations for each zone and update delegation records.
See [After Epoch End](#After-Epoch-End).
See [After Epoch End](#after-epoch-end).

- **Query:** `cosmos.staking.v1beta1.Query/DelegatorDelegations`
- **Callback:** `DelegationsCallback`

#### Delegate Total Rewards

Withdraw delegation rewards for each zone and distribute.
See [After Epoch End](#After-Epoch-End).
See [After Epoch End](#after-epoch-end).

- **Query:** `cosmos.distribution.v1beta1.Query/DelegationTotalRewards`
- **Callback:** `RewardsCallback`

#### WithdrawalAddress Balances

Triggered by `HandleWithdrawRewards`.
See [MsgWithdrawDelegatorReward](#MsgWithdrawDelegatorReward).
See [MsgWithdrawDelegatorReward](#msgwithdrawdelegatorreward).

- **Query:** `cosmos.bank.v1beta1.Query/AllBalances`
- **Callback:** `DistributeRewardsFromWithdrawAccount`
Expand Down
Loading