-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ping.pub explorer support (#87)
* feat: add ping.pub explorer support * chore: fixed links
- Loading branch information
1 parent
3338726
commit 696c541
Showing
6 changed files
with
97 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package types | ||
|
||
type Chains []*Chain | ||
|
||
func (c Chains) FindByName(name string) *Chain { | ||
for _, chain := range c { | ||
if chain.Name == name { | ||
return chain | ||
} | ||
} | ||
|
||
return nil | ||
} |
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,31 @@ | ||
package types | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFindChainByNameIfPresent(t *testing.T) { | ||
t.Parallel() | ||
|
||
chains := Chains{ | ||
{Name: "chain1"}, | ||
{Name: "chain2"}, | ||
} | ||
|
||
chain := chains.FindByName("chain2") | ||
assert.NotNil(t, chain, "Chain should be presented!") | ||
} | ||
|
||
func TestFindChainByNameIfNotPresent(t *testing.T) { | ||
t.Parallel() | ||
|
||
chains := Chains{ | ||
{Name: "chain1"}, | ||
{Name: "chain2"}, | ||
} | ||
|
||
chain := chains.FindByName("chain3") | ||
assert.Nil(t, chain, "Chain should not be presented!") | ||
} |
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,6 @@ | ||
package types | ||
|
||
type Explorer struct { | ||
ProposalLinkPattern string `toml:"proposal-link-pattern"` | ||
WalletLinkPattern string `toml:"wallet-link-pattern"` | ||
} |