Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
remove unused config type:
Browse files Browse the repository at this point in the history
  • Loading branch information
P1sar committed Jul 7, 2021
1 parent 2a7e128 commit 5fec844
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion chains/evm/evmclient/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ func createGeneralConfig() config.GeneralChainConfig {
var id uint8 = 1
return config.GeneralChainConfig{
Name: "chain",
Type: "ethereum",
Id: &id,
Endpoint: "endpoint",
From: "0x0",
Expand Down
1 change: 0 additions & 1 deletion chains/evm/evmclient/evm-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func NewEVMClient() *EVMClient {
return &EVMClient{}
}

// TO implement interface Configurable
func (c *EVMClient) Configurate(path string, name string) error {
rawCfg, err := GetConfig(path, name)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

type GeneralChainConfig struct {
Name string `mapstructure:"name"`
Type string `mapstructure:"type"`
Id *uint8 `mapstructure:"id"`
Endpoint string `mapstructure:"endpoint"`
From string `mapstructure:"from"`
Expand All @@ -26,9 +25,6 @@ func (c *GeneralChainConfig) Validate() error {
if c.Id == nil {
return fmt.Errorf("required field chain.Id empty for chain %v", c.Id)
}
if c.Type == "" {
return fmt.Errorf("required field chain.Type empty for chain %v", *c.Id)
}
if c.Endpoint == "" {
return fmt.Errorf("required field chain.Endpoint empty for chain %v", *c.Id)
}
Expand Down
5 changes: 0 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,34 @@ func TestValidateConfig(t *testing.T) {
var id uint8 = 1
valid := GeneralChainConfig{
Name: "chain",
Type: "ethereum",
Id: &id,
Endpoint: "endpoint",
From: "0x0",
}

missingType := GeneralChainConfig{
Name: "chain",
Type: "",
Id: &id,
Endpoint: "endpoint",
From: "0x0",
}

missingEndpoint := GeneralChainConfig{
Name: "chain",
Type: "ethereum",
Id: &id,
Endpoint: "",
From: "0x0",
}

missingName := GeneralChainConfig{
Name: "",
Type: "ethereum",
Id: &id,
Endpoint: "endpoint",
From: "0x0",
}

missingId := GeneralChainConfig{
Name: "chain",
Type: "ethereum",
Endpoint: "endpoint",
From: "0x0",
}
Expand Down

0 comments on commit 5fec844

Please sign in to comment.