diff --git a/packages/common-universal/src/types/CheckedAddress.test.ts b/packages/common-universal/src/types/CheckedAddress.test.ts index 0bd3de5f3..f492dba1a 100644 --- a/packages/common-universal/src/types/CheckedAddress.test.ts +++ b/packages/common-universal/src/types/CheckedAddress.test.ts @@ -27,7 +27,7 @@ describe(CheckedAddress.name, () => { it('generates a random address with prefix', () => { const address = CheckedAddress.random('alice') - expect(address.toLowerCase()).toMatchRegex(/^0x0000a11ce[0-9a-f]{31}$/) + expect(address.toLowerCase()).toMatchRegex(/^0xdeadbeefa11ce[0-9a-f]{27}$/) }) }) }) diff --git a/packages/common-universal/src/types/CheckedAddress.ts b/packages/common-universal/src/types/CheckedAddress.ts index 9b985de96..8e791c17c 100644 --- a/packages/common-universal/src/types/CheckedAddress.ts +++ b/packages/common-universal/src/types/CheckedAddress.ts @@ -19,7 +19,7 @@ export function CheckedAddress(value: string): CheckedAddress { * Generates a random address. Tries to represent desired ascii prefix as hex value. Helps to identify transactions in the logs. */ CheckedAddress.random = (asciiPrefix = ''): CheckedAddress => { - const constantAddressPrefix = '0000' + const constantAddressPrefix = 'deadbeef' const hexPrefix = asciiToHex(asciiPrefix) const postfixLength = 40 - hexPrefix.length - constantAddressPrefix.length assert(postfixLength >= 0, `Prefix too long: ${asciiPrefix}`) diff --git a/packages/common-universal/src/types/Hex.ts b/packages/common-universal/src/types/Hex.ts index f04a0c567..cf485e971 100644 --- a/packages/common-universal/src/types/Hex.ts +++ b/packages/common-universal/src/types/Hex.ts @@ -19,7 +19,7 @@ export function Hex(hex: string, { allowEmpty = false } = {}): Hex { } Hex.random = (ascii = '', length = 64): Hex => { - const constantHexPrefix = '0000' + const constantHexPrefix = 'deadbeef' assert(ascii.length <= length - constantHexPrefix.length, `Ascii prefix too long: ${ascii}`) assert(length >= constantHexPrefix.length, `Total length too short: ${length}`) return Hex(