Skip to content

Commit 3106c56

Browse files
authored
add Previewnet codeword for address generation (#703)
1 parent 3daeafe commit 3106c56

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

address.go

+5
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ func chainCustomizer(chain ChainID) uint64 {
108108
return 0
109109
case Testnet:
110110
return invalidCodeTestNetwork
111+
case Previewnet:
112+
return invalidCodePreviewNetwork
111113
case Emulator, Localnet, Benchnet, BftTestnet:
112114
return invalidCodeTransientNetwork
113115
default:
@@ -271,6 +273,9 @@ const (
271273

272274
// invalidCodeTransientNetwork is the invalid codeword used for transient test networks.
273275
invalidCodeTransientNetwork = uint64(0x1cb159857af02018)
276+
277+
// invalidCodePreviewNetwork is the invalid codeword used for Preview networks.
278+
invalidCodePreviewNetwork = uint64(0x5211829E88528817)
274279
)
275280

276281
// Rows of the generator matrix G of the [64,45]-code used for Flow addresses.

address_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestAddressConstants(t *testing.T) {
9595
Mainnet,
9696
Testnet,
9797
Emulator,
98+
Previewnet,
9899
}
99100

100101
for _, net := range networks {
@@ -135,6 +136,7 @@ func TestAddressGeneration(t *testing.T) {
135136
Mainnet,
136137
Testnet,
137138
Emulator,
139+
Previewnet,
138140
}
139141

140142
for _, net := range networks {

0 commit comments

Comments
 (0)