Skip to content

Commit

Permalink
feat: allow hard tabs in code blocks in md files
Browse files Browse the repository at this point in the history
* disable MD010 for `code_blocks`
* revert and re `markdownlint -fix` all the .md files
  • Loading branch information
tzdybal committed Apr 10, 2022
1 parent f1ae476 commit 4280b44
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
default: true
MD010:
code_blocks: false
MD013: false
MD024:
allow_different_nesting: true
Expand Down
62 changes: 31 additions & 31 deletions docs/lazy-adr/adr-006-da-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@ Definition of interface:

```go
type DataAvailabilityLayerClient interface {
// Init is called once to allow DA client to read configuration and initialize resources.
Init(config []byte, kvStore store.KVStore, logger log.Logger) error
// Init is called once to allow DA client to read configuration and initialize resources.
Init(config []byte, kvStore store.KVStore, logger log.Logger) error

Start() error
Stop() error
Start() error
Stop() error

// SubmitBlock submits the passed in block to the DA layer.
// This should create a transaction which (potentially)
// triggers a state transition in the DA layer.
SubmitBlock(block *types.Block) ResultSubmitBlock
// SubmitBlock submits the passed in block to the DA layer.
// This should create a transaction which (potentially)
// triggers a state transition in the DA layer.
SubmitBlock(block *types.Block) ResultSubmitBlock

// CheckBlockAvailability queries DA layer to check block's data availability.
CheckBlockAvailability(block *types.Block) ResultCheckBlock
// CheckBlockAvailability queries DA layer to check block's data availability.
CheckBlockAvailability(block *types.Block) ResultCheckBlock
}

// BlockRetriever is additional interface that can be implemented by Data Availability Layer Client that is able to retrieve
// block data from DA layer. This gives the ability to use it for block synchronization.
type BlockRetriever interface {
RetrieveBlock(height uint64) ResultRetrieveBlock
RetrieveBlock(height uint64) ResultRetrieveBlock
}

// TODO define an enum of different non-happy-path cases
Expand All @@ -55,40 +55,40 @@ type StatusCode uint64

// Data Availability return codes.
const (
StatusUnknown StatusCode = iota
StatusSuccess
StatusTimeout
StatusError
StatusUnknown StatusCode = iota
StatusSuccess
StatusTimeout
StatusError
)

type DAResult struct {
// Code is to determine if the action succeeded.
Code StatusCode
// Message may contain DA layer specific information (like DA block height/hash, detailed error message, etc)
Message string
// Code is to determine if the action succeeded.
Code StatusCode
// Message may contain DA layer specific information (like DA block height/hash, detailed error message, etc)
Message string
}

// ResultSubmitBlock contains information returned from DA layer after block submission.
type ResultSubmitBlock struct {
DAResult
// Not sure if this needs to be bubbled up to other
// parts of Optimint.
// Hash hash.Hash
DAResult
// Not sure if this needs to be bubbled up to other
// parts of Optimint.
// Hash hash.Hash
}

// ResultCheckBlock contains information about block availability, returned from DA layer client.
type ResultCheckBlock struct {
DAResult
// DataAvailable is the actual answer whether the block is available or not.
// It can be true if and only if Code is equal to StatusSuccess.
DataAvailable bool
DAResult
// DataAvailable is the actual answer whether the block is available or not.
// It can be true if and only if Code is equal to StatusSuccess.
DataAvailable bool
}

type ResultRetrieveBlock struct {
DAResult
// Block is the full block retrieved from Data Availability Layer.
// If Code is not equal to StatusSuccess, it has to be nil.
Block *types.Block
DAResult
// Block is the full block retrieved from Data Availability Layer.
// If Code is not equal to StatusSuccess, it has to be nil.
Block *types.Block
}
```
>
Expand Down

0 comments on commit 4280b44

Please sign in to comment.