-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add algorand network names (#675)
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 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,17 @@ | ||
package algorand | ||
|
||
const ( | ||
// Mainnet network name. | ||
Mainnet = "mainnet" | ||
|
||
// Betanet network name. | ||
Betanet = "betanet" | ||
|
||
// Testnet network name. | ||
Testnet = "testnet" | ||
) | ||
|
||
// Networks supported by substrate package. | ||
func Networks() []string { | ||
return []string{Mainnet, Betanet, Testnet} | ||
} |
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,26 @@ | ||
package algorand | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestNetworks(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
want []string | ||
}{ | ||
{ | ||
"success", | ||
[]string{"mainnet", "betanet", "testnet"}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := Networks(); !assert.Equal(t, tt.want, got) { | ||
t.Errorf("Networks() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |