-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set address current network for non-mainnet since default is changed (#…
…12574) Default `address.CurrentNetwork` was changed in an upstream dependency. Update the build constants for non-mainnet to explicitly set it to `Testnet`. Add tests to assert it.
- Loading branch information
Showing
8 changed files
with
100 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
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,16 @@ | ||
//go:build debug || 2k | ||
// +build debug 2k | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.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,16 @@ | ||
//go:build butterflynet | ||
// +build butterflynet | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.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,16 @@ | ||
//go:build calibnet | ||
// +build calibnet | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.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,16 @@ | ||
//go:build interopnet | ||
// +build interopnet | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.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,16 @@ | ||
//go:build !debug && !2k && !testground && !calibnet && !butterflynet && !interopnet | ||
// +build !debug,!2k,!testground,!calibnet,!butterflynet,!interopnet | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.Mainnet) | ||
} |
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,16 @@ | ||
//go:build testground | ||
// +build testground | ||
|
||
package buildconstants | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/filecoin-project/go-address" | ||
) | ||
|
||
func Test_NetworkName(t *testing.T) { | ||
require.Equal(t, address.CurrentNetwork, address.Testnet) | ||
} |