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

chore: spell check CI #906

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[codespell]
skip = *.pb.*,*.sum,go.mod
quiet-level = 2
ignore-words = .github/workflows/spell-check-ignore.txt
2 changes: 2 additions & 0 deletions .github/workflows/spell-check-ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
crate
pres
24 changes: 24 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Spell Check

on:
pull_request:

jobs:
spellcheck:
name: Run codespell
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install codespell
run: pip install codespell

- name: Run codespell
run: codespell
3 changes: 2 additions & 1 deletion chain/cosmos/08-wasm-types/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types/module"

//grpc "github.com/cosmos/gogoproto/grpc"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -38,7 +39,7 @@ func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return nil
}

// ValidateGenesis performs a no-op. Genesis is not supported for the tendermint light cilent.
// ValidateGenesis performs a no-op. Genesis is not supported for the tendermint light client.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ func (tn *ChainNode) StartContainer(ctx context.Context) error {
if err != nil {
return err
}
// TODO: reenable this check, having trouble with it for some reason
// TODO: re-enable this check, having trouble with it for some reason
if stat != nil && stat.SyncInfo.CatchingUp {
return fmt.Errorf("still catching up: height(%d) catching-up(%t)",
stat.SyncInfo.LatestBlockHeight, stat.SyncInfo.CatchingUp)
Expand Down
2 changes: 1 addition & 1 deletion chain/internal/tendermint/tendermint_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (tn *TendermintNode) StartContainer(ctx context.Context) error {
// tn.t.Log(err)
return err
}
// TODO: reenable this check, having trouble with it for some reason
// TODO: re-enable this check, having trouble with it for some reason
if stat != nil && stat.SyncInfo.CatchingUp {
return fmt.Errorf("still catching up: height(%d) catching-up(%t)",
stat.SyncInfo.LatestBlockHeight, stat.SyncInfo.CatchingUp)
Expand Down
2 changes: 1 addition & 1 deletion chain/penumbra/penumbra_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func (c *PenumbraChain) RecoverKey(ctx context.Context, name, mnemonic string) e
func (c *PenumbraChain) GetAddress(ctx context.Context, keyName string) ([]byte, error) {
fn := c.getFullNode()
if fn.PenumbraAppNode == nil {
return nil, fmt.Errorf("no penumbra app nodes configured to retreive an address from")
return nil, fmt.Errorf("no penumbra app nodes configured to retrieve an address from")
}
return fn.PenumbraAppNode.GetAddress(ctx, keyName)
}
Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ To get started, follow these steps:
git clone https://github.com/<Username>/interchaintest.git
```

3. Crate a new branch on your fork
3. Create a new branch on your fork

```sh
git checkout -b name/broad-description-of-feature
git checkout -b name/broad-description-of-feature
```

4. Make your changes and commit them with descriptive commit messages.
Expand Down
10 changes: 5 additions & 5 deletions docs/ciTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ It's important to realize the image will be named using the arg from the `-c` fl
**Goal:** When a PR is created, have a GitHub workflow that:

1. Builds a Docker image with the latest code changes to the binary.
2. Synchronously spin up runners (one for each test), load Docker image, and run tests.
2. Synchronously spin up runners (one for each test), load Docker image, and run tests.

We recommend having this workflow run only on PR's.

Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
strategy:
matrix:
# names of `make` commands to run tests
test:
test:
- ictest-tkn-factory
- ictest-packet-forward
- ictest-paramauthority
Expand All @@ -132,7 +132,7 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: checkout chain
uses: actions/checkout@v3

Expand Down Expand Up @@ -224,7 +224,7 @@ The example below will spin up 9 runners, one for each test.
strategy:
matrix:
# names of `make` commands to run tests
test:
test:
- ictest-tkn-factory
- ictest-packet-forward
- ictest-paramauthority
Expand All @@ -241,7 +241,7 @@ The example below will spin up 9 runners, one for each test.
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: checkout chain
uses: actions/checkout@v3

Expand Down
10 changes: 5 additions & 5 deletions docs/conformance-tests-bin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`interchaintest` comes with a suite of conformance tests. These tests ensure IBC and relayer compatibility. On a high-level it tests:
- `client`, `channel`, and `connection` creation
- messages are properly relayed and acknowledged
- messages are properly relayed and acknowledged
- packets are being properly timed out

You can view all the specific conformance test by reviewing them in the [conformance](../conformance/) folder.
Expand All @@ -20,7 +20,7 @@ go test -v ./cmd/interchaintest/
### Custom Environment
Using the binary allows for easy custom chain pairs and custom testing environments.

This is accomplished via the `-matrix` argument.
This is accomplished via the `-matrix` argument.
```shell
interchaintest -matrix <path/to/matrix.json>
```
Expand All @@ -39,13 +39,13 @@ By passing in a matrix file you can customize these aspects of the environment:

**Pre-Configured Chains**

`interchaintest` comes with [pre-configured chains](../configuredChains.yaml).
In the matrix file, if `Name` matches the name of any pre-configured chain, `interchaintest` will use standard settings UNLESS overriden in the matrix file. [example_matrix_custom.json](../cmd/interchaintest/example_matrix_custom.json) is an example of overriding all options.
`interchaintest` comes with [pre-configured chains](../configuredChains.yaml).
In the matrix file, if `Name` matches the name of any pre-configured chain, `interchaintest` will use standard settings UNLESS overridden in the matrix file. [example_matrix_custom.json](../cmd/interchaintest/example_matrix_custom.json) is an example of overriding all options.


**Custom Binaries**
Chain binaries must be installed in a docker container.
The `Image` array in the matrix json file allows you to pass in docker images with your chain binary of choice.
The `Image` array in the matrix json file allows you to pass in docker images with your chain binary of choice.
If the docker image does not live in a public repository, can you **pass in a local docker image like so:**

```json
Expand Down
8 changes: 4 additions & 4 deletions docs/conformance-tests-lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can view all the specific conformance test by reviewing them in the [conform

## Importing Conformance Tests In Your Project

`interchaintest` can be imported into your own packages to be used as a library as well as being used from the
`interchaintest` can be imported into your own packages to be used as a library as well as being used from the
binary itself, see [here](conformance-tests-bin.md).

A common pattern when importing `interchaintest` into your own repositories is to use a Go submodule. The reason being
Expand All @@ -21,16 +21,16 @@ to use specific versions of dependencies. To avoid this issue one will typically

The main entrypoint exposed by the `conformance` package is a function named `Test`.

Here is the function signature of `Test`:
Here is the function signature of `Test`:
```go
func Test(t *testing.T, ctx context.Context, cfs []interchaintest.ChainFactory, rfs []interchaintest.RelayerFactory, rep *testreporter.Reporter)
```

It accepts a normal `testing.T` and `context.Context` from the Go standard library as well as a few types defined in `interchaintest`.
It accepts a normal `testing.T` and `context.Context` from the Go standard library as well as a few types defined in `interchaintest`.

- `testreporter.Reporter` is used for collecting detailed test reports, you can read more about it [here](../testreporter/doc.go).
- `interchaintest.ChainFactory` is used to define which chain pairs should be used in conformance testing.
- `interchaintest.RelayerFactory` is used to define which relayer implementations should be used to test IBC functionality between your chain pairs.
- `interchaintest.RelayerFactory` is used to define which relayer implementations should be used to test IBC functionality between your chain pairs.

It is important to note that the `Test` function accepts a slice of `ChainFactory`, currently the `conformance` tests only work against
a pair of two chains at a time. This means that each `ChainFactory` should only contain definitions for two chains,
Expand Down
32 changes: 16 additions & 16 deletions docs/writeCustomTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

This document breaks down code snippets from [learn_ibc_test.go](../examples/ibc/learn_ibc_test.go). This test:

1) Spins up two chains (Gaia and Osmosis)
1) Spins up two chains (Gaia and Osmosis)
2) Creates an IBC Path between them (client, connection, channel)
3) Sends an IBC transaction between them.

It validates each step and confirms that the balances of each wallet are correct.
It validates each step and confirms that the balances of each wallet are correct.


### Three basic components of `interchaintest`:
Expand All @@ -26,21 +26,21 @@ cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaint
})
```

The chain factory is where you configure your chain binaries.
The chain factory is where you configure your chain binaries.

`interchaintest` needs a docker image with the chain binary(s) installed to spin up the local testnet.
`interchaintest` needs a docker image with the chain binary(s) installed to spin up the local testnet.

`interchaintest` has several [pre-configured chains](../configuredChains.yaml). These docker images are pulled from [Heighliner](https://github.com/strangelove-ventures/heighliner) (repository of docker images of many IBC enabled chains). Note that Heighliner needs to have the `Version` you are requesting.

When creating your `ChainFactory`, if the `Name` matches the name of a pre-configured chain, the pre-configured settings are used. You can override these settings by passing them into the `ibc.ChainConfig` when initializing your ChainFactory. We do this above with `GasPrices` for gaia.

You can also pass in **remote images** and/or **local docker images**.
You can also pass in **remote images** and/or **local docker images**.

See an examples below:

```go
cf := interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(t), []*interchaintest.ChainSpec{

// -- PRE CONFIGURED CHAIN EXAMPLE --
{Name: "gaia", Version: "v7.0.2"},

Expand Down Expand Up @@ -71,7 +71,7 @@ If you are not using a pre-configured chain, you must fill out all values of the

By default, `interchaintest` will spin up a 3 docker images for each chain:
- 2 validator nodes
- 1 full node.
- 1 full node.

These settings can all be configured inside the `ChainSpec`.

Expand All @@ -94,9 +94,9 @@ gaia, osmosis := chains[0], chains[1]

## Relayer Factory

The relayer factory is where relayer docker images are configured.
The relayer factory is where relayer docker images are configured.

Currently only the [Cosmos/Relayer](https://github.com/cosmos/relayer)(CosmosRly) is integrated into `interchaintest`.
Currently only the [Cosmos/Relayer](https://github.com/cosmos/relayer)(CosmosRly) is integrated into `interchaintest`.

Here we prep an image with the Cosmos/Relayer:
```go
Expand All @@ -107,7 +107,7 @@ r := interchaintest.NewBuiltinRelayerFactory(ibc.CosmosRly, zaptest.NewLogger(t)

## Interchain

This is where we configure our test-net/interchain.
This is where we configure our test-net/interchain.

We prep the "interchain" by adding chains, a relayer, and specifying which chains to create IBC paths for:

Expand Down Expand Up @@ -146,20 +146,20 @@ Upon calling build, several things happen (specifically for cosmos based chains)
- 1 trillion "stake" are staked
- 100 billion "stake" are self delegated
- Each chain gets a faucet address (key named "faucet") with 10 billion units of denom funded in genesis
- The relayer wallet gets 1 billion units of each chains denom funded in genesis
- The relayer wallet gets 1 billion units of each chains denom funded in genesis
- Genesis for each chain takes place
- IBC paths are created: `client`, `connection`, `channel` for each link


Note that this function takes a `testReporter`. This will instruct `interchaintest` to export and reports of the test(s). The `RelayerExecReporter` satisfies the reporter requirement.
Note that this function takes a `testReporter`. This will instruct `interchaintest` to export and reports of the test(s). The `RelayerExecReporter` satisfies the reporter requirement.

Note: If report files are not needed, you can use `testreporter.NewNopReporter()` instead.


Passing in the optional `BlockDatabaseFile` will instruct `interchaintest` to create a sqlite3 database with all block history. This includes raw event data.


Unless specified, default options are used for `client`, `connection`, and `channel` creation.
Unless specified, default options are used for `client`, `connection`, and `channel` creation.


Default `createChannelOptions` are:
Expand Down Expand Up @@ -206,7 +206,7 @@ osmosisUser := users[1]

## Interacting with the Interchain

Now that the interchain is built, you can interact with each binary.
Now that the interchain is built, you can interact with each binary.

EXAMPLE: Getting the RPC address:
```go
Expand All @@ -225,7 +225,7 @@ transfer := ibc.WalletAmount{
tx, err := gaia.SendIBCTransfer(ctx, gaiaChannelID, gaiaUser.KeyName, transfer, ibc.TransferOptions{})
```

The `Exec` method allows any arbitrary command to be passed into a chain binary or relayer binary.
The `Exec` method allows any arbitrary command to be passed into a chain binary or relayer binary.

EXAMPLE: Sending an IBC transfer with the `Exec`:
```go
Expand Down
2 changes: 1 addition & 1 deletion examples/ibc/wasm/wasm_ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestWasmIbc(t *testing.T) {
func() {
err := r.StopRelayer(ctx, eRep)
if err != nil {
t.Logf("an error occured while stopping the relayer: %s", err)
t.Logf("an error occurred while stopping the relayer: %s", err)
}
},
)
Expand Down
2 changes: 1 addition & 1 deletion examples/ibc/wasm/wasm_icq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func TestInterchainQueriesWASM(t *testing.T) {
func() {
err := r.StopRelayer(ctx, eRep)
if err != nil {
t.Logf("an error occured while stopping the relayer: %s", err)
t.Logf("an error occurred while stopping the relayer: %s", err)
}
},
)
Expand Down
4 changes: 2 additions & 2 deletions internal/blockdb/tui/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ func TestModel_Update(t *testing.T) {

update(runeKey('c'))

_, primative := model.mainContentView().GetFrontPage()
_, primitive := model.mainContentView().GetFrontPage()
// TODO (nix - 6/22/22) Can't get text from a tview.Modal. We could use a tview.TextView but it does not render
// properly with the nested flex views.
require.IsType(t, &tview.Modal{}, primative.(*tview.Flex).GetItem(1).(*tview.Flex).GetItem(1))
require.IsType(t, &tview.Modal{}, primitive.(*tview.Flex).GetItem(1).(*tview.Flex).GetItem(1))
})
}
4 changes: 2 additions & 2 deletions internal/dockerutil/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type DockerSetupTestingT interface {

// CleanupLabel is a docker label key targeted by DockerSetup when it cleans up docker resources.
//
// "interchaintest" is perhaps a better name. However, for backwards compatability we preserve the original name of "ibc-test"
// "interchaintest" is perhaps a better name. However, for backwards compatibility we preserve the original name of "ibc-test"
// with the hyphen. Otherwise, we run the risk of causing "container already exists" errors because DockerSetup
// is unable to clean old resources from docker engine.
const CleanupLabel = "ibc-test"
Expand Down Expand Up @@ -93,7 +93,7 @@ func dockerCleanup(t DockerSetupTestingT, cli *client.Client) func() {
return func() {
showContainerLogs := os.Getenv("SHOW_CONTAINER_LOGS")
containerLogTail := os.Getenv("CONTAINER_LOG_TAIL")
keepContainers := os.Getenv("KEEP_CONTAINERS") != ""
keepContainers := os.Getenv("KEEP_CONTAINTERS") != ""

ctx := context.TODO()
cli.NegotiateAPIVersion(ctx)
Expand Down
4 changes: 2 additions & 2 deletions local-interchain/cmd/local-ic/new_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var newChainCmd = &cobra.Command{
name := strings.TrimSuffix(args[0], ".json")
filePath := path.Join(GetDirectory(), "chains", fmt.Sprintf("%s.json", name))

// while loop to allow for IBC conncetions to work as expected. Else set IBC as []string{}
// while loop to allow for IBC connections to work as expected. Else set IBC as []string{}

text, _ := os.ReadFile(filePath)
if len(text) > 0 {
Expand All @@ -55,7 +55,7 @@ var newChainCmd = &cobra.Command{
ChainID: getOrDefault("chain_id", "local-1"),
Binary: getOrDefault("App Binary", "junod"),
Bech32Prefix: getOrDefault("Bech32 Prefix", "juno"),
GasPrices: getOrDefault("gas_prices (comma seperated)", "0ujuno,0other"),
GasPrices: getOrDefault("gas_prices (comma separated)", "0ujuno,0other"),
GasAdjustment: getOrDefault("gas_adjustment", 2.5),

// IBCPaths should be unique chain ids?
Expand Down
Loading
Loading