Skip to content

Commit 29f3aca

Browse files
committed
Export CurrentNetwork
1 parent 55c7b90 commit 29f3aca

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

address.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var addressAtlasEntry = atlas.BuildEntry(Address{}).Transform().
3232
})).
3333
Complete()
3434

35-
// currentNetwork specifies which network the address belongs to
36-
var currentNetwork = Testnet
35+
// CurrentNetwork specifies which network the address belongs to
36+
var CurrentNetwork = Testnet
3737

3838
// Address is the go type that represents an address in the filecoin network.
3939
type Address struct{ str string }
@@ -96,7 +96,7 @@ func (a Address) Bytes() []byte {
9696

9797
// String returns an address encoded as a string.
9898
func (a Address) String() string {
99-
str, err := encode(currentNetwork, a)
99+
str, err := encode(CurrentNetwork, a)
100100
if err != nil {
101101
panic(err) // I don't know if this one is okay
102102
}

address_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func TestVectorSecp256k1Address(t *testing.T) {
203203

204204
// Testnet
205205
// Round trip encoding and decoding from string
206-
currentNetwork = Testnet
206+
CurrentNetwork = Testnet
207207
addr, err := NewSecp256k1Address(tc.input)
208208
assert.NoError(err)
209209
assert.Equal(tc.expectedTestnetAddrStr, addr.String())
@@ -229,7 +229,7 @@ func TestVectorSecp256k1Address(t *testing.T) {
229229

230230
// Mainnet
231231
// Round trip encoding and decoding from string
232-
currentNetwork = Mainnet
232+
CurrentNetwork = Mainnet
233233
assert.Equal(tc.expectedMainnetAddrStr, addr.String())
234234

235235
maybeMainnetAddr, err := NewFromString(tc.expectedMainnetAddrStr)
@@ -319,7 +319,7 @@ func TestVectorActorAddress(t *testing.T) {
319319

320320
// Testnet
321321
// Round trip encoding and decoding from string
322-
currentNetwork = Testnet
322+
CurrentNetwork = Testnet
323323
addr, err := NewActorAddress(tc.input)
324324
assert.NoError(err)
325325
assert.Equal(tc.expectedTestnetAddrStr, addr.String())
@@ -345,7 +345,7 @@ func TestVectorActorAddress(t *testing.T) {
345345

346346
// Mainnet
347347
// Round trip encoding and decoding from string
348-
currentNetwork = Mainnet
348+
CurrentNetwork = Mainnet
349349
assert.Equal(tc.expectedMainnetAddrStr, addr.String())
350350

351351
maybeMainnetAddr, err := NewFromString(tc.expectedMainnetAddrStr)
@@ -425,7 +425,7 @@ func TestVectorBLSAddress(t *testing.T) {
425425

426426
// Testnet
427427
// Round trip encoding and decoding from string
428-
currentNetwork = Testnet
428+
CurrentNetwork = Testnet
429429
addr, err := NewBLSAddress(tc.input)
430430
assert.NoError(err)
431431
assert.Equal(tc.expectedTestnetAddrStr, addr.String())
@@ -451,7 +451,7 @@ func TestVectorBLSAddress(t *testing.T) {
451451

452452
// Mainnet
453453
// Round trip encoding and decoding from string
454-
currentNetwork = Mainnet
454+
CurrentNetwork = Mainnet
455455
assert.Equal(tc.expectedMainnetAddrStr, addr.String())
456456

457457
maybeMainnetAddr, err := NewFromString(tc.expectedMainnetAddrStr)

0 commit comments

Comments
 (0)