-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade gomock dependency.
- Loading branch information
Alessio Treglia
authored
Mar 4, 2020
1 parent
b9ab834
commit da5c6ce
Showing
16 changed files
with
606 additions
and
53 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
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
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,47 @@ | ||
package types_test | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func TestConfig_SetCoinType(t *testing.T) { | ||
config := &sdk.Config{} | ||
require.Equal(t, uint32(0), config.GetCoinType()) | ||
config.SetCoinType(99) | ||
require.Equal(t, uint32(99), config.GetCoinType()) | ||
|
||
config.Seal() | ||
require.Panics(t, func() { config.SetCoinType(99) }) | ||
} | ||
|
||
func TestConfig_SetTxEncoder(t *testing.T) { | ||
mockErr := errors.New("test") | ||
config := &sdk.Config{} | ||
require.Nil(t, config.GetTxEncoder()) | ||
encFunc := sdk.TxEncoder(func(tx sdk.Tx) ([]byte, error) { return nil, nil }) | ||
config.SetTxEncoder(encFunc) | ||
_, err := config.GetTxEncoder()(sdk.Tx(nil)) | ||
require.Error(t, mockErr, err) | ||
|
||
config.Seal() | ||
require.Panics(t, func() { config.SetTxEncoder(encFunc) }) | ||
} | ||
|
||
func TestConfig_SetFullFundraiserPath(t *testing.T) { | ||
config := &sdk.Config{} | ||
require.Equal(t, "", config.GetFullFundraiserPath()) | ||
config.SetFullFundraiserPath("test/path") | ||
require.Equal(t, "test/path", config.GetFullFundraiserPath()) | ||
|
||
config.Seal() | ||
require.Panics(t, func() { config.SetFullFundraiserPath("x/test/path") }) | ||
} | ||
|
||
func TestKeyringServiceName(t *testing.T) { | ||
require.Equal(t, sdk.DefaultKeyringServiceName, sdk.KeyringServiceName()) | ||
} |
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
Oops, something went wrong.