-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add in base test auction keeper with mocked expected keepers * Fix bug in keystore lookup & do happy path for BeginAuction * Minor bug fix and happy path for finishing auction * lint * test * Msg server happy path unit test * Partial implementation for abci test * Abci unit test happy path * Partially fulfilled bid test * Partial unhappy path for msg server * Finish unhappy path tests for msg server * Make linter happy * Finish unhappy paths for keeper, msg server, & abci * Add genesis unit testing and fix up genesis import + add validate basic ccheck to token price setting * Proposal handler unit testing * Query server tests * Add auction types validation testing and remove some unnecessary errors * Genesis validate test * Add in msg validation test * Add params validate test * Proposal validation test * Cli query tests * Tx unit tests * Add auction module account keeper * Added mock account keeper * Partial unit test update to account for new expected keeper * Update unit tests to account for latest updates in integration test sister PR * lint * Tidy * Partial address of comments * More feedback being addressed * Unit test workflow * Address review comments
- Loading branch information
1 parent
1b305e6
commit fd56a1f
Showing
34 changed files
with
3,585 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Unit tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.16] | ||
os: [ubuntu-latest] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v3 | ||
- run: go test github.com/peggyjv/sommelier/.../x/... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package testutil | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/std" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
"github.com/cosmos/cosmos-sdk/x/auth/tx" | ||
) | ||
|
||
// TODO(pbal): This is copied from an unreleased version of the cosmos sdk. Upon upgrading our sdk version to 0.46.1 we should import this file | ||
|
||
// TestEncodingConfig defines an encoding configuration that is used for testing | ||
// purposes. Note, MakeTestEncodingConfig takes a series of AppModuleBasic types | ||
// which should only contain the relevant module being tested and any potential | ||
// dependencies. | ||
type TestEncodingConfig struct { | ||
InterfaceRegistry types.InterfaceRegistry | ||
Codec codec.Codec | ||
TxConfig client.TxConfig | ||
Amino *codec.LegacyAmino | ||
} | ||
|
||
func MakeTestEncodingConfig(modules ...module.AppModuleBasic) TestEncodingConfig { | ||
cdc := codec.NewLegacyAmino() | ||
interfaceRegistry := types.NewInterfaceRegistry() | ||
codec := codec.NewProtoCodec(interfaceRegistry) | ||
|
||
encCfg := TestEncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Codec: codec, | ||
TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes), | ||
Amino: cdc, | ||
} | ||
|
||
mb := module.NewBasicManager(modules...) | ||
|
||
std.RegisterLegacyAminoCodec(encCfg.Amino) | ||
std.RegisterInterfaces(encCfg.InterfaceRegistry) | ||
mb.RegisterLegacyAminoCodec(encCfg.Amino) | ||
mb.RegisterInterfaces(encCfg.InterfaceRegistry) | ||
|
||
return encCfg | ||
} |
Oops, something went wrong.