Skip to content

Commit

Permalink
add previewnet
Browse files Browse the repository at this point in the history
  • Loading branch information
bluesign committed Mar 27, 2024
1 parent c10ce02 commit 4b28ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cadence/contracts/AddressUtils.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ pub contract AddressUtils {
let codeWords: {String: UInt64} = {
"MAINNET" : 0,
"TESTNET" : 0x6834ba37b3980209,
"EMULATOR": 0x1cb159857af02018
"EMULATOR": 0x1cb159857af02018,
"PREVIEWNET": 0x5211829e88528817
}

let parityCheckMatrixColumns: [UInt64] = [
Expand Down
3 changes: 2 additions & 1 deletion test/AddressUtils_test.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ fun testIsValidAddress() {
let mainnet = AddressUtils.isValidAddress("0xa340dc0a4ec828ab", forNetwork: "MAINNET")
let testnet = AddressUtils.isValidAddress("0x31ad40c07a2a9788", forNetwork: "TESTNET")
let emulator = AddressUtils.isValidAddress("0xf8d6e0586b0a20c7", forNetwork: "EMULATOR")
let previewnet = AddressUtils.isValidAddress("0x30a71a4767f0e14f", forNetwork: "PREVIEWNET")

// Assert
Test.assert(mainnet && testnet && emulator)
Test.assert(mainnet && testnet && emulator && previewnet)

// Act
var valid = AddressUtils.isValidAddress(1452, forNetwork: "EMULATOR")
Expand Down

0 comments on commit 4b28ebb

Please sign in to comment.