it('should return all edges that end at a specific point', () => {
                fc.assert(
                    fc.property(edgesArbitrary, nodeConfigArbitrary, (edges, nodeConfig) => {
                        const edge = edges.at(-1)
                        fc.pre(edge != null)
                        fc.pre(edges.map((e) => e.vector).every(isVectorPossible))

                        const builder = new OmniGraphBuilder()
                        const nodes = edges.flatMap(({ vector: { from, to } }) => [
                            { point: from, config: nodeConfig },
                            { point: to, config: nodeConfig },
                        ])

                        builder.addNodes(...nodes).addEdges(...edges)

                        const edgesTo = builder.edges.filter(({ vector }) => arePointsEqual(vector.to, edge!.vector.to))
                        expect(builder.getEdgesTo(edge!.vector.to)).toEqual(edgesTo)
                    })
                )
            })


unknown

it('should return padded values for address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    const bytes = makeBytes32(address)

                    expect(bytes.length).toBe(66)
                    expect(BigInt(bytes)).toBe(BigInt(address))
                })
            )
        })


it('should return identity for bytes32', () => {
            fc.assert(
                fc.property(evmBytes32Arbitrary, (bytes) => {
                    expect(makeBytes32(bytes)).toBe(bytes)
                })
            )
        })


it('should return true for two nullish values', () => {
            fc.assert(
                fc.property(zeroishBytes32Arbitrary, zeroishBytes32Arbitrary, (a, b) => {
                    expect(areBytes32Equal(a, b)).toBe(true)
                })
            )
        })


it('should return true for two identical values', () => {
            fc.assert(
                fc.property(evmBytes32Arbitrary, (a) => {
                    expect(areBytes32Equal(a, a)).toBe(true)
                })
            )
        })


it('should return true for an address and bytes', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    expect(areBytes32Equal(address, makeBytes32(address))).toBe(true)
                })
            )
        })


it('should return false for a zeroish value and a non-zeroish address', () => {
            fc.assert(
                fc.property(zeroishBytes32Arbitrary, evmAddressArbitrary, (bytes, address) => {
                    fc.pre(!isZero(address))

                    expect(areBytes32Equal(bytes, address)).toBe(false)
                })
            )
        })


it('should return false for a zeroish value and a non-zeroish bytes', () => {
            fc.assert(
                fc.property(zeroishBytes32Arbitrary, evmBytes32Arbitrary, (a, b) => {
                    fc.pre(!isZero(b))

                    expect(areBytes32Equal(a, b)).toBe(false)
                })
            )
        })


it('should return true for identical UInt8Arrays', () => {
            fc.assert(
                fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {
                    expect(areBytes32Equal(bytes, bytes)).toBe(true)
                })
            )
        })


it('should return true for a UInt8Array & its hex representation', () => {
            fc.assert(
                fc.property(fc.uint8Array({ minLength: 1, maxLength: 32 }), (bytes) => {
                    expect(areBytes32Equal(bytes, makeBytes32(bytes))).toBe(true)
                })
            )
        })


it('should return false two non-matching UInt8Array instances', () => {
            fc.assert(
                fc.property(
                    fc.uint8Array({ minLength: 1, maxLength: 32 }),
                    fc.uint8Array({ minLength: 1, maxLength: 32 }),
                    (a, b) => {
                        // We need to filter out matching arrays
                        fc.pre(
                            // We walk over the first array and check that there is at least one non-matching element
                            //
                            // We default any missing (undefined) values in the second array to 0
                            // since any leading zeros are equal to undefined
                            a.some((v, i) => v !== b[i] || 0) ||
                                // And we do the same for the second array (since we don't know which one lis longer)
                                b.some((v, i) => v !== a[i] || 0)
                        )

                        expect(areBytes32Equal(a, b)).toBe(false)
                    }
                )
            )
        })


it('should return false two a UInt8Array & non-matching hex string', () => {
            fc.assert(
                fc.property(
                    fc.uint8Array({ minLength: 1, maxLength: 32 }),
                    fc.uint8Array({ minLength: 1, maxLength: 32 }),
                    (a, b) => {
                        fc.pre(
                            // We walk over the first array and check that there is at least one non-matching element
                            //
                            // We default any missing (undefined) values in the second array to 0
                            // since any leading zeros are equal to undefined
                            a.some((v, i) => v !== b[i]) ||
                                // And we do the same for the second array (since we don't know which one lis longer)
                                b.some((v, i) => v !== a[i])
                        )

                        expect(areBytes32Equal(a, makeBytes32(b))).toBe(false)
                    }
                )
            )
        })


it('should return false with non-zero address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    fc.pre(address !== AddressZero)

                    expect(isZero(address)).toBe(false)
                })
            )
        })


it('should return false with non-zero bytes32', () => {
            fc.assert(
                fc.property(evmBytes32Arbitrary, (address) => {
                    fc.pre(address !== ZERO_BYTES)

                    expect(isZero(address)).toBe(false)
                })
            )
        })


it('should return true with a zero-only UInt8Array', () => {
            fc.assert(
                fc.property(fc.uint8Array({ min: 0, max: 0 }), (bytes) => {
                    expect(isZero(bytes)).toBe(true)
                })
            )
        })


it('should return false with a non-zero UInt8Array', () => {
            fc.assert(
                fc.property(fc.uint8Array({ minLength: 1 }), (bytes) => {
                    fc.pre(bytes.some((byte) => byte !== 0))

                    expect(isZero(bytes)).toBe(false)
                })
            )
        })


it('should return address with non-zero address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    fc.pre(address !== AddressZero)

                    expect(ignoreZero(address)).toBe(address)
                })
            )
        })


it('should return 0 for two identical addresses', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    expect(compareBytes32Ascending(address, address)).toBe(0)
                    expect(compareBytes32Ascending(address, makeBytes32(address))).toBe(0)
                    expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(address))).toBe(0)
                })
            )
        })


it('should return a negative value for zero address and any other address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    fc.pre(!isZero(address))

                    expect(compareBytes32Ascending(AddressZero, address)).toBeLessThan(0)
                    expect(compareBytes32Ascending(AddressZero, makeBytes32(address))).toBeLessThan(0)
                    expect(compareBytes32Ascending(makeBytes32(AddressZero), address)).toBeLessThan(0)
                    expect(compareBytes32Ascending(makeBytes32(AddressZero), makeBytes32(address))).toBeLessThan(0)
                })
            )
        })


it('should return a positive value for zero address and any other address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    fc.pre(!isZero(address))

                    expect(compareBytes32Ascending(address, AddressZero)).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(makeBytes32(address), AddressZero)).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(address, makeBytes32(AddressZero))).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(makeBytes32(address), makeBytes32(AddressZero))).toBeGreaterThan(0)
                })
            )
        })


it('should return a negative if address comes before the other address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {
                    fc.pre(addressA.toLowerCase() < addressB.toLowerCase())

                    expect(compareBytes32Ascending(addressA, addressB)).toBeLessThan(0)
                    expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeLessThan(0)
                    expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeLessThan(0)
                    expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeLessThan(0)
                })
            )
        })


it('should return a negative if address comes after the other address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, evmAddressArbitrary, (addressA, addressB) => {
                    fc.pre(addressA.toLowerCase() > addressB.toLowerCase())

                    expect(compareBytes32Ascending(addressA, addressB)).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(makeBytes32(addressA), addressB)).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(addressA, makeBytes32(addressB))).toBeGreaterThan(0)
                    expect(compareBytes32Ascending(makeBytes32(addressA), makeBytes32(addressB))).toBeGreaterThan(0)
                })
            )
        })


it('should resolve if all resolve', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, async (values) => {
                    const tasks = values.map((value) => jest.fn().mockResolvedValue(value))

                    expect(await sequence(tasks)).toEqual(values)

                    // Make sure all the tasks got called
                    for (const task of tasks) {
                        expect(task).toHaveBeenCalledTimes(1)
                        expect(task).toHaveBeenCalledWith()
                    }
                })
            )
        })


it('should reject with the first rejection', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (values1, error, values2) => {
                    const tasks1 = values1.map((value) => jest.fn().mockResolvedValue(value))
                    const failingTask = jest.fn().mockRejectedValue(error)
                    const tasks2 = values2.map((value) => jest.fn().mockResolvedValue(value))
                    const tasks = [...tasks1, failingTask, ...tasks2]

                    await expect(sequence(tasks)).rejects.toBe(error)

                    // Make sure the first batch got called
                    for (const task of tasks1) {
                        expect(task).toHaveBeenCalledTimes(1)
                        expect(task).toHaveBeenCalledWith()
                    }

                    // Make sure the failing task got called
                    expect(failingTask).toHaveBeenCalledTimes(1)
                    expect(failingTask).toHaveBeenCalledWith()

                    // Make sure the second batch didn't get called
                    for (const task of tasks2) {
                        expect(task).not.toHaveBeenCalled()
                    }
                })
            )
        })


it('should execute one by one', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, async (values) => {
                    fc.pre(values.length > 0)

                    const tasks = values.map((value) => jest.fn().mockResolvedValue(value))

                    await sequence(tasks)

                    tasks.reduce((task1, task2) => {
                        return expect(task1).toHaveBeenCalledBefore(task2), task2
                    })
                })
            )
        })


it('should resolve if the first task resolves', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, errors) => {
                    const task = jest.fn().mockResolvedValue(value)
                    const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))

                    expect(await first([task, ...tasks])).toBe(value)

                    // Make sure none of the other factories got called
                    for (const factory of tasks) {
                        expect(factory).not.toHaveBeenCalled()
                    }
                })
            )
        })


it('should resolve with the first successful task', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {
                    const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))
                    const task = jest.fn().mockResolvedValue(value)

                    expect(await first([...tasks, task])).toBe(value)

                    // Make sure all the tasks got called
                    for (const factory of tasks) {
                        expect(factory).toHaveBeenCalledTimes(1)
                    }

                    expect(task).toHaveBeenCalledTimes(1)
                })
            )
        })


it('should reject with the last rejected task error', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, error) => {
                    const tasks = errors.map((error) => jest.fn().mockRejectedValue(error))
                    const task = jest.fn().mockRejectedValue(error)

                    await expect(first([...tasks, task])).rejects.toBe(error)

                    // Make sure all the tasks got called
                    for (const factory of tasks) {
                        expect(factory).toHaveBeenCalledTimes(1)
                    }

                    expect(task).toHaveBeenCalledTimes(1)
                })
            )
        })


it('should resolve if the first factory resolves', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valuesArbitrary, async (value, values) => {
                    const successful = jest.fn().mockResolvedValue(value)
                    const successfulOther = values.map((value) => jest.fn().mockResolvedValue(value))
                    const factory = firstFactory(successful, ...successfulOther)

                    expect(await factory()).toBe(value)

                    // Make sure none of the other factories got called
                    for (const factory of successfulOther) {
                        expect(factory).not.toHaveBeenCalled()
                    }
                })
            )
        })


it('should resolve with the first successful factory', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, valueArbitrary, async (errors, value) => {
                    const failing = errors.map((error) => jest.fn().mockRejectedValue(error))
                    const successful = jest.fn().mockResolvedValue(value)
                    const factory = firstFactory(...failing, successful)

                    expect(await factory()).toBe(value)

                    // Make sure all the tasks got called
                    for (const factory of failing) {
                        expect(factory).toHaveBeenCalledTimes(1)
                    }
                })
            )
        })


it('should pass the input to factories', async () => {
            await fc.assert(
                fc.asyncProperty(valuesArbitrary, valueArbitrary, valuesArbitrary, async (errors, value, args) => {
                    const failing = errors.map((error) => jest.fn().mockRejectedValue(error))
                    const successful = jest.fn().mockResolvedValue(value)
                    const factory = firstFactory(...failing, successful)

                    expect(await factory(...args)).toBe(value)

                    // Make sure all the tasks got called with the correct arguments
                    for (const factory of failing) {
                        expect(factory).toHaveBeenCalledTimes(1)
                        expect(factory).toHaveBeenCalledWith(...args)
                    }

                    expect(successful).toHaveBeenCalledTimes(1)
                    expect(successful).toHaveBeenCalledWith(...args)
                })
            )
        })


it('should resolve with the return value of a synchronous task', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (value) => {
                    const task = jest.fn().mockReturnValue(value)
                    const handleError = jest.fn()

                    await expect(mapError(task, handleError)).resolves.toBe(value)
                    expect(handleError).not.toHaveBeenCalled()
                })
            )
        })


it('should resolve with the resolution value of an asynchronous task', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (value) => {
                    const task = jest.fn().mockResolvedValue(value)
                    const handleError = jest.fn()

                    await expect(mapError(task, handleError)).resolves.toBe(value)
                    expect(handleError).not.toHaveBeenCalled()
                })
            )
        })


it('should reject and call the toError callback if a synchronous task throws', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {
                    const task = jest.fn().mockImplementation(() => {
                        throw error
                    })
                    const handleError = jest.fn().mockReturnValue(mappedError)

                    await expect(mapError(task, handleError)).rejects.toBe(mappedError)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should reject and call the toError callback if an asynchronous task rejects', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, mappedError) => {
                    const task = jest.fn().mockRejectedValue(error)
                    const handleError = jest.fn().mockReturnValue(mappedError)

                    await expect(mapError(task, handleError)).rejects.toBe(mappedError)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should resolve with the return value of a synchronous task', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (value) => {
                    const task = jest.fn().mockReturnValue(value)
                    const handleError = jest.fn()

                    await expect(tapError(task, handleError)).resolves.toBe(value)
                    expect(handleError).not.toHaveBeenCalled()
                })
            )
        })


it('should resolve with the resolution value of an asynchronous task', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (value) => {
                    const task = jest.fn().mockResolvedValue(value)
                    const handleError = jest.fn()

                    await expect(tapError(task, handleError)).resolves.toBe(value)
                    expect(handleError).not.toHaveBeenCalled()
                })
            )
        })


it('should reject and call the onError callback if a synchronous task throws', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (error) => {
                    const task = jest.fn().mockImplementation(() => {
                        throw error
                    })
                    const handleError = jest.fn()

                    await expect(tapError(task, handleError)).rejects.toBe(error)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should reject and call the onError callback if an asynchronous task rejects', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, async (error) => {
                    const task = jest.fn().mockRejectedValue(error)
                    const handleError = jest.fn()

                    await expect(tapError(task, handleError)).rejects.toBe(error)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should reject with the original error if the onError callback throws', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {
                    const task = jest.fn().mockRejectedValue(error)
                    const handleError = jest.fn().mockImplementation(() => {
                        throw anotherError
                    })

                    await expect(tapError(task, handleError)).rejects.toBe(error)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should reject with the original error if the onError callback rejects', async () => {
            await fc.assert(
                fc.asyncProperty(valueArbitrary, valueArbitrary, async (error, anotherError) => {
                    const task = jest.fn().mockRejectedValue(error)
                    const handleError = jest.fn().mockRejectedValue(anotherError)

                    await expect(tapError(task, handleError)).rejects.toBe(error)
                    expect(handleError).toHaveBeenCalledOnce()
                    expect(handleError).toHaveBeenCalledExactlyOnceWith(error)
                })
            )
        })


it('should throw', () => {
                fc.assert(
                    fc.property(numAttemptsArbitrary, (numAttempts) => {
                        expect(() => createSimpleRetryStrategy(numAttempts)).toThrow()
                    })
                )
            })


it('should return a function that returns true until numAttempts is reached', () => {
                    fc.assert(
                        fc.property(numAttemptsArbitrary, (numAttempts) => {
                            const strategy = createSimpleRetryStrategy(numAttempts)

                            // The first N attempts should return true since we want to retry them
                            for (let attempt = 1; attempt <= numAttempts; attempt++) {
                                expect(strategy(attempt, 'error', [], [])).toBeTruthy()
                            }

                            // The N+1th attempt should return false
                            expect(strategy(numAttempts + 1, 'error', [], [])).toBeFalsy()
                        })
                    )
                })


it('should return false if the amount of attempts has been reached, the wrapped strategy value otherwise', () => {
                    fc.assert(
                        fc.property(numAttemptsArbitrary, (numAttempts) => {
                            // We'll create a simple wrapped strategy
                            const wrappedStrategy = (attempt: number) => [attempt]
                            const strategy = createSimpleRetryStrategy(numAttempts, wrappedStrategy)

                            // The first N attempts should return the return value of the wrapped strategy
                            for (let attempt = 1; attempt <= numAttempts; attempt++) {
                                expect(strategy(attempt, 'error', [0], [0])).toEqual(wrappedStrategy(attempt))
                            }

                            // The N+1th attempt should return false
                            expect(strategy(numAttempts + 1, 'error', [0], [0])).toBeFalsy()
                        })
                    )
                })


it('should call forEach correctly', () => {
                fc.assert(
                    fc.property(fc.array(fc.tuple(keyArbitrary, valueArbitrary)), (entries) => {
                        const map = new TestMap(entries)
                        const callback = jest.fn()

                        map.forEach(callback)

                        // We'll get the entries from the map since the original entries
                        // might contain duplicates
                        const mapEntries = Array.from(map.entries())
                        expect(callback).toHaveBeenCalledTimes(mapEntries.length)

                        for (const [key, value] of mapEntries) {
                            expect(callback).toHaveBeenCalledWith(value, key, map)
                        }
                    })
                )
            })


it('should use orElse if a key is not defined', () => {
                fc.assert(
                    fc.property(keyArbitrary, valueArbitrary, valueArbitrary, (key, value, orElseValue) => {
                        const map = new TestMap()
                        const orElse = jest.fn().mockReturnValue(orElseValue)

                        // Sanity check first
                        expect(map.has(key)).toBeFalsy()

                        // If the key has not been set, the map should use orElse
                        expect(map.getOrElse(key, orElse)).toBe(orElseValue)

                        // Set a value first
                        map.set(key, value)

                        // And check that orElse is not being used
                        expect(map.getOrElse(key, orElse)).toBe(value)

                        // Now delete the value
                        map.delete(key)

                        // And check that orElse is being used again
                        expect(map.getOrElse(key, orElse)).toBe(orElseValue)
                    })
                )
            })


it('should normalize a nullish value to empty bytes', () => {
                fc.assert(
                    fc.property(evmEndpointArbitrary, nullishArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(normalized).toEqual(new Uint8Array(32))
                        expect(isZero(normalized)).toBe(true)
                        expect(isZero(denormalized)).toBe(true)
                    })
                )
            })


it('should normalize a peer correctly', () => {
                fc.assert(
                    fc.property(evmEndpointArbitrary, evmAddressArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(denormalized).toBe(address)
                    })
                )
            })


it('should normalize a nullish value to empty bytes', () => {
                fc.assert(
                    fc.property(aptosEndpointArbitrary, nullishArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(normalized).toEqual(new Uint8Array(32))
                        expect(isZero(normalized)).toBe(true)
                        expect(isZero(denormalized)).toBe(true)
                    })
                )
            })


it('should normalize a peer correctly', () => {
                fc.assert(
                    fc.property(aptosEndpointArbitrary, aptosAddressArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(denormalized).toBe(address)
                    })
                )
            })


it('should normalize a nullish value to empty bytes', () => {
                fc.assert(
                    fc.property(solanaEndpointArbitrary, nullishArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(normalized).toEqual(new Uint8Array(32))
                        expect(isZero(normalized)).toBe(true)
                        expect(isZero(denormalized)).toBe(true)
                    })
                )
            })


it('should normalize a peer correctly', () => {
                fc.assert(
                    fc.property(solanaEndpointArbitrary, solanaAddressArbitrary, (eid, address) => {
                        const normalized = normalizePeer(address, eid)
                        const denormalized = denormalizePeer(normalized, eid)

                        expect(denormalized).toBe(address)
                    })
                )
            })


it('should return true for identical values', () => {
            fc.assert(
                fc.property(fc.anything(), (value) => {
                    expect(isDeepEqual(value, value)).toBeTruthy()
                })
            )
        })


it('should return true for arrays containing the same values', () => {
            fc.assert(
                fc.property(arrayArbitrary, (array) => {
                    expect(isDeepEqual(array, [...array])).toBeTruthy()
                    expect(isDeepEqual([...array], array)).toBeTruthy()
                })
            )
        })


it('should return false for arrays containing different values', () => {
            fc.assert(
                fc.property(arrayArbitrary, arrayArbitrary, (arrayA, arrayB) => {
                    // We'll do a very simplified precondition - we'll only run tests when the first elements are different
                    fc.pre(!isDeepEqual(arrayA[0], arrayB[0]))

                    expect(isDeepEqual(arrayA, arrayB)).toBeFalsy()
                    expect(isDeepEqual(arrayB, arrayA)).toBeFalsy()
                })
            )
        })


it('should return false for arrays containing more values', () => {
            fc.assert(
                fc.property(arrayArbitrary, fc.anything(), (array, extraValue) => {
                    expect(isDeepEqual(array, [...array, extraValue])).toBeFalsy()
                    expect(isDeepEqual([...array, extraValue], array)).toBeFalsy()
                })
            )
        })


it('should return true for sets containing the same values', () => {
            fc.assert(
                fc.property(arrayArbitrary, (array) => {
                    const setA = new Set(array)
                    const setB = new Set(array)

                    expect(isDeepEqual(setA, setB)).toBeTruthy()
                    expect(isDeepEqual(setB, setA)).toBeTruthy()
                })
            )
        })


it('should return true for maps containing the same values', () => {
            fc.assert(
                fc.property(entriesArbitrary, (entries) => {
                    const mapA = new Map(entries)
                    const mapB = new Map(entries)

                    expect(isDeepEqual(mapA, mapB)).toBeTruthy()
                    expect(isDeepEqual(mapB, mapA)).toBeTruthy()
                })
            )
        })


it('should return true for objects containing the same values', () => {
            fc.assert(
                fc.property(
                    fc.record({
                        value: fc.anything(),
                    }),
                    (object) => {
                        expect(isDeepEqual(object, { ...object })).toBeTruthy()
                        expect(isDeepEqual({ ...object }, object)).toBeTruthy()
                    }
                )
            )
        })


it('should return false for objects containing different values', () => {
            fc.assert(
                fc.property(
                    fc.record({
                        value: fc.anything(),
                    }),
                    fc.anything(),
                    (object, value) => {
                        fc.pre(!isDeepEqual(object.value, value))

                        expect(isDeepEqual(object, { value })).toBeFalsy()
                        expect(isDeepEqual({ value }, object)).toBeFalsy()
                    }
                )
            )
        })


it('should sign a transaction', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        endpointArbitrary,
                        solanaAddressArbitrary,
                        keypairArbitrary,
                        keypairArbitrary,
                        async (eid, address, sender, recipient) => {
                            const transfer = SystemProgram.transfer({
                                fromPubkey: sender.publicKey,
                                toPubkey: recipient.publicKey,
                                lamports: 49,
                            })

                            const connection = new Connection('http://soyllama.com')
                            const omniSigner = new OmniSignerSolana(eid, connection, sender)

                            const transaction = new Transaction().add(transfer)
                            transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'
                            transaction.feePayer = sender.publicKey

                            const omniTransaction: OmniTransaction = {
                                point: { eid, address },
                                data: serializeTransactionMessage(transaction),
                            }

                            const signature = await omniSigner.sign(omniTransaction)
                            const serializedTransaction = (transaction.sign(sender), transaction.serialize())

                            expect(deserializeTransactionBuffer(signature)).toEqual(serializedTransaction)
                        }
                    )
                )
            })


it('should sign and send a transaction', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        endpointArbitrary,
                        solanaAddressArbitrary,
                        keypairArbitrary,
                        keypairArbitrary,
                        fc.string(),
                        async (eid, address, sender, recipient, transactionHash) => {
                            sendAndConfirmTransactionMock.mockResolvedValue(transactionHash)

                            const transfer = SystemProgram.transfer({
                                fromPubkey: sender.publicKey,
                                toPubkey: recipient.publicKey,
                                lamports: 49,
                            })

                            const connection = new Connection('http://soyllama.com')
                            const omniSigner = new OmniSignerSolana(eid, connection, sender)

                            const transaction = new Transaction().add(transfer)
                            transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'
                            transaction.feePayer = sender.publicKey

                            const omniTransaction: OmniTransaction = {
                                point: { eid, address },
                                data: serializeTransactionMessage(transaction),
                            }

                            const response = await omniSigner.signAndSend(omniTransaction)
                            expect(response).toEqual({
                                transactionHash,
                                wait: expect.any(Function),
                            })

                            expect(await response.wait()).toEqual({ transactionHash })
                        }
                    )
                )
            })


it('should throw an error', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        endpointArbitrary,
                        solanaAddressArbitrary,
                        keypairArbitrary,
                        keypairArbitrary,
                        async (eid, address, sender, recipient) => {
                            const transfer = SystemProgram.transfer({
                                fromPubkey: sender.publicKey,
                                toPubkey: recipient.publicKey,
                                lamports: 49,
                            })

                            const connection = new Connection('http://soyllama.com')
                            const multiSigAddress = PublicKey.default
                            const wallet = Keypair.generate()
                            const omniSigner: OmniSigner = new OmniSignerSolanaSquads(
                                eid,
                                connection,
                                multiSigAddress,
                                wallet
                            )

                            const transaction = new Transaction().add(transfer)
                            transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'
                            transaction.feePayer = sender.publicKey

                            const omniTransaction: OmniTransaction = {
                                point: { eid, address },
                                data: serializeTransactionMessage(transaction),
                            }

                            await expect(omniSigner.sign(omniTransaction)).rejects.toThrow(
                                'OmniSignerSolanaSquads does not support the sign() method. Please use signAndSend().'
                            )
                        }
                    )
                )
            })


it('should work', async () => {
            await fc.assert(
                fc.asyncProperty(keypairArbitrary, keypairArbitrary, async (sender, recipient) => {
                    const transfer = SystemProgram.transfer({
                        fromPubkey: sender.publicKey,
                        toPubkey: recipient.publicKey,
                        lamports: 49,
                    })

                    const transaction = new Transaction().add(transfer)

                    // Transaction in Solana require a recent block hash to be set in order for them to be serialized
                    transaction.recentBlockhash = 'EETubP5AKHgjPAhzPAFcb8BAY1hMH639CWCFTqi3hq1k'

                    // Transactions in Solana require a fee payer to be set in order for them to be serialized
                    transaction.feePayer = sender.publicKey

                    // First we serialize the transaction
                    const serializedTransaction = serializeTransactionMessage(transaction)
                    // Then we deserialize it
                    const deserializedTransaction = deserializeTransactionMessage(serializedTransaction)
                    // And check that the fields match the original transaction
                    //
                    // The reason why we don't compare the transactions directly is that the signers will not match
                    // after deserialization (the signers get stripped out of the original transaction)
                    expect(deserializedTransaction.instructions).toEqual(transaction.instructions)
                    expect(deserializedTransaction.recentBlockhash).toEqual(transaction.recentBlockhash)
                    expect(deserializedTransaction.feePayer).toEqual(transaction.feePayer)

                    // Now we serialize the deserialized transaction again and check that it fully matches the serialized transaction
                    const reserializedTransaction = serializeTransactionMessage(deserializedTransaction)
                    expect(reserializedTransaction).toEqual(serializedTransaction)
                })
            )
        })


it('should reject if urlFactory throws', async () => {
            await fc.assert(
                fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {
                    const urlFactory = jest.fn().mockImplementation(() => {
                        throw error
                    })
                    const providerFactory = createConnectionFactory(urlFactory)

                    await expect(providerFactory(eid)).rejects.toBe(error)
                })
            )
        })


it('should reject if urlFactory rejects', async () => {
            await fc.assert(
                fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {
                    const urlFactory = jest.fn().mockRejectedValue(error)
                    const providerFactory = createConnectionFactory(urlFactory)

                    await expect(providerFactory(eid)).rejects.toBe(error)
                })
            )
        })


it('should resolve with Connection if urlFactory returns a URL', async () => {
            await fc.assert(
                fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {
                    const urlFactory = jest.fn().mockReturnValue(url)
                    const connectionFactory = createConnectionFactory(urlFactory)
                    const connection = await connectionFactory(eid)

                    expect(connection).toBeInstanceOf(Connection)
                    expect(connection.rpcEndpoint).toBe(url)
                })
            )
        })


it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {
            await fc.assert(
                fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {
                    const urlFactory = jest.fn().mockResolvedValue(url)
                    const connectionFactory = createConnectionFactory(urlFactory)
                    const connection = await connectionFactory(eid)

                    expect(connection).toBeInstanceOf(Connection)
                    expect(connection.rpcEndpoint).toBe(url)
                })
            )
        })


it('should throw an error for other endpoints', () => {
            fc.assert(
                fc.property(endpointArbitrary, (eid) => {
                    fc.pre(eid !== EndpointId.SOLANA_V2_MAINNET)
                    fc.pre(eid !== EndpointId.SOLANA_V2_TESTNET)
                    fc.pre(eid !== EndpointId.SOLANA_MAINNET)
                    fc.pre(eid !== EndpointId.SOLANA_TESTNET)

                    expect(() => defaultRpcUrlFactory(eid)).toThrow(
                        `Could not find a default Solana RPC URL for eid ${eid} (${formatEid(eid)})`
                    )
                })
            )
        })


it('should parse a BN instance', () => {
            fc.assert(
                fc.property(bnArbitrary, (bn) => {
                    expect(BNBigIntSchema.parse(bn)).toBe(BigInt(bn.toString()))
                })
            )
        })


it('should not parse anything else', () => {
            fc.assert(
                fc.property(fc.anything(), (value) => {
                    expect(() => BNBigIntSchema.parse(value)).toThrow(/Input not instance of BN/)
                })
            )
        })


it('should parse a PublicKey instance', () => {
            fc.assert(
                fc.property(
                    keypairArbitrary.map((keypair) => keypair.publicKey),
                    (publicKey) => {
                        expect(PublicKeySchema.parse(publicKey)).toBe(publicKey)
                    }
                )
            )
        })


it('should not parse anything else', () => {
            fc.assert(
                fc.property(fc.anything(), (value) => {
                    expect(() => PublicKeySchema.parse(value)).toThrow(/Input not instance of PublicKey/)
                })
            )
        })


it('should return undefined if the account has not been initialized', async () => {
            getAccountInfoMock.mockResolvedValue(null)

            await fc.assert(
                fc.asyncProperty(solanaEndpointArbitrary, keypairArbitrary, async (eid, keypair) => {
                    fc.pre(eid !== EndpointId.SOLANA_V2_SANDBOX)

                    const address = keypair.publicKey.toBase58()

                    const connection = await connectionFactory(oftConfig.eid)
                    const getAccountInfo = createGetAccountInfo(connection)

                    expect(await getAccountInfo(address)).toBeUndefined()
                })
            )
        })


it('should serialize an external message', () => {
            fc.assert(
                fc.property(cellArbitrary, (body) => {
                    const message = external({
                        to: wallet.address,
                        body,
                    })

                    const serialized = serializeMessage(message)
                    const deserialized = deserializeMessage(serialized)

                    // FIXME Jest comparison operators don't work well with message objects
                    // so a workaround expectation is used
                    //
                    // See https://github.com/ton-core/ton-core/blob/e0ed819973daf0484dfbacd0c30a0dcfe4714f8d/src/types/MessageRelaxed.spec.ts
                    expect(Cell.fromBase64(serialized).equals(messageToCell(message))).toBeTruthy()

                    const reserialized = serializeMessage(deserialized)
                    expect(reserialized).toEqual(serialized)
                })
            )
        })

Summary: An external message, when serialized and then deserialized, should produce an identical serialized output.


it('should add a feePayer and the latest block hash to the transaction', async () => {
            await fc.assert(
                fc.asyncProperty(
                    endpointArbitrary,
                    solanaAddressArbitrary,
                    keypairArbitrary,
                    keypairArbitrary,
                    solanaBlockhashArbitrary,
                    async (eid, address, sender, recipient, blockhash) => {
                        class TestOmniSDK extends OmniSDK {
                            test() {
                                const transfer = SystemProgram.transfer({
                                    fromPubkey: sender.publicKey,
                                    toPubkey: recipient.publicKey,
                                    lamports: 49,
                                })
                                const transaction = new Transaction().add(transfer)

                                return this.createTransaction(transaction)
                            }
                        }

                        const connection = new Connection('http://soyllama.com')
                        jest.spyOn(connection, 'getLatestBlockhash').mockResolvedValue({
                            blockhash,
                            lastValidBlockHeight: NaN,
                        })

                        const sdk = new TestOmniSDK(connection, { eid, address }, sender.publicKey)
                        const omniTransaction = await sdk.test()

                        expect(omniTransaction).toEqual({
                            data: expect.any(String),
                            point: { eid, address },
                        })
                    }
                )
            )
        })


it('should parse BigNumberish', () => {
            fc.assert(
                fc.property(bigNumberishArbitrary, (bigNumberish) => {
                    expect(BigNumberishSchema.parse(bigNumberish)).toBe(bigNumberish)
                })
            )
        })


it('should parse BigNumberish into a bigint', () => {
            fc.assert(
                fc.property(bigNumberishArbitrary, (bigNumberish) => {
                    const parsed = BigNumberishBigIntSchema.parse(bigNumberish)

                    expect(typeof parsed).toBe('bigint')
                    expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))
                })
            )
        })


it('should parse BigNumberish into a number if within bounds', () => {
            fc.assert(
                fc.property(bigNumberishArbitrary, (bigNumberish) => {
                    fc.pre(BigNumber.from(bigNumberish).abs().lte(BigInt(Number.MAX_SAFE_INTEGER)))

                    const parsed = BigNumberishNumberSchema.parse(bigNumberish)

                    expect(typeof parsed).toBe('number')
                    expect(BigNumber.from(parsed)).toEqual(BigNumber.from(bigNumberish))
                })
            )
        })


it('should throw an error if there is an overflow', () => {
            fc.assert(
                fc.property(bigNumberishArbitrary, (bigNumberish) => {
                    fc.pre(BigNumber.from(bigNumberish).abs().gt(BigInt(Number.MAX_SAFE_INTEGER)))

                    expect(() => BigNumberishNumberSchema.parse(bigNumberish)).toThrow('overflow')
                })
            )
        })


it('should reject if urlFactory throws', async () => {
            await fc.assert(
                fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {
                    const urlFactory = jest.fn().mockImplementation(() => {
                        throw error
                    })
                    const providerFactory = createProviderFactory(urlFactory)

                    await expect(providerFactory(eid)).rejects.toBe(error)
                })
            )
        })


it('should reject if urlFactory rejects', async () => {
            await fc.assert(
                fc.asyncProperty(errorArbitrary, endpointArbitrary, async (error, eid) => {
                    const urlFactory = jest.fn().mockRejectedValue(error)
                    const providerFactory = createProviderFactory(urlFactory)

                    await expect(providerFactory(eid)).rejects.toBe(error)
                })
            )
        })


it('should resolve with JsonRpcProvider if urlFactory returns a URL', async () => {
            await fc.assert(
                fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {
                    const urlFactory = jest.fn().mockReturnValue(url)
                    const providerFactory = createProviderFactory(urlFactory)
                    const provider = await providerFactory(eid)

                    expect(provider).toBeInstanceOf(JsonRpcProvider)
                    expect(provider.connection.url).toBe(url)
                })
            )
        })


it('should resolve with JsonRpcProvider if urlFactory resolves with a URL', async () => {
            await fc.assert(
                fc.asyncProperty(urlArbitrary, endpointArbitrary, async (url, eid) => {
                    const urlFactory = jest.fn().mockResolvedValue(url)
                    const providerFactory = createProviderFactory(urlFactory)
                    const provider = await providerFactory(eid)

                    expect(provider).toBeInstanceOf(JsonRpcProvider)
                    expect(provider.connection.url).toBe(url)
                })
            )
        })


it('should create an OmniPoint with the address of the contract', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, endpointArbitrary, (address, eid) => {
                    const contract = new Contract(address, [])
                    const omniContract: OmniContract = { eid, contract }

                    expect(omniContractToPoint(omniContract)).toEqual({ eid, address })
                })
            )
        })


it('should serialize correctly with a message', () => {
            fc.assert(
                fc.property(messageArbitrary, (message) => {
                    fc.pre(message !== '')

                    expect(String(new UnknownError(message))).toBe(`UnknownError: ${message}`)
                })
            )
        })


it('should serialize correctly when message is not passed', () => {
            fc.assert(
                fc.property(reasonArbitrary, (reason) => {
                    expect(String(new PanicError(reason))).toBe(
                        `PanicError: Contract panicked (assert() has been called). Error code ${reason}`
                    )
                })
            )
        })


it('should serialize correctly when message is empty', () => {
            fc.assert(
                fc.property(reasonArbitrary, (reason) => {
                    expect(String(new PanicError(reason, ''))).toBe(`PanicError. Error code ${reason}`)
                })
            )
        })


it('should serialize correctly with a message', () => {
            fc.assert(
                fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {
                    fc.pre(message !== '')

                    expect(String(new PanicError(reason, message))).toBe(`PanicError: ${message}. Error code ${reason}`)
                })
            )
        })


it('should serialize correctly when message is not passed', () => {
            fc.assert(
                fc.property(reasonArbitrary, (reason) => {
                    expect(String(new RevertError(reason))).toBe(
                        `RevertError: Contract reverted. Error reason '${reason}'`
                    )
                })
            )
        })


it('should serialize correctly when message is empty', () => {
            fc.assert(
                fc.property(reasonArbitrary, (reason) => {
                    expect(String(new RevertError(reason, ''))).toBe(`RevertError. Error reason '${reason}'`)
                })
            )
        })


it('should serialize correctly with a message', () => {
            fc.assert(
                fc.property(reasonArbitrary, messageArbitrary, (reason, message) => {
                    fc.pre(message !== '')

                    expect(String(new RevertError(reason, message))).toBe(
                        `RevertError: ${message}. Error reason '${reason}'`
                    )
                })
            )
        })


it('should serialize correctly when args are empty', () => {
            fc.assert(
                fc.property(reasonArbitrary, (reason) => {
                    expect(String(new CustomError(reason, []))).toBe(
                        `CustomError: Contract reverted with custom error. Error ${reason}()`
                    )
                })
            )
        })


it('should serialize correctly when message is not passed', () => {
            fc.assert(
                fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {
                    const formattedArgs = args.map((arg) => printJson(arg, false))

                    expect(String(new CustomError(reason, args))).toBe(
                        `CustomError: Contract reverted with custom error. Error ${reason}(${formattedArgs})`
                    )
                })
            )
        })


it('should serialize correctly when message is empty', () => {
            fc.assert(
                fc.property(reasonArbitrary, argsArbitrary, (reason, args) => {
                    const formattedArgs = args.map((arg) => printJson(arg, false))

                    expect(String(new CustomError(reason, args, ''))).toBe(
                        `CustomError. Error ${reason}(${formattedArgs})`
                    )
                })
            )
        })


it('should serialize correctly with a message', () => {
            fc.assert(
                fc.property(reasonArbitrary, argsArbitrary, messageArbitrary, (reason, args, message) => {
                    fc.pre(message !== '')

                    const formattedArgs = args.map((arg) => printJson(arg, false))

                    expect(String(new CustomError(reason, args, message))).toBe(
                        `CustomError: ${message}. Error ${reason}(${formattedArgs})`
                    )
                })
            )
        })


it('should return address with non-zero address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    fc.pre(address !== AddressZero)

                    expect(makeZeroAddress(address)).toBe(address)
                })
            )
        })


it('should return the same address, just checksumed', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    expect(addChecksum(address)).toEqualCaseInsensitive(address)
                })
            )
        })


it('should return a valid EVM address', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    expect(isAddress(addChecksum(address))).toBe(true)
                })
            )
        })


it('should not override user values if provided', () => {
            fc.assert(
                fc.property(
                    fc.integer(),
                    fc.string(),
                    mnemonicArbitrary,
                    fc.boolean(),
                    (port, directory, mnemonic, overwriteAccounts) => {
                        expect(
                            resolveSimulationConfig(
                                { port, directory, overwriteAccounts, anvil: { mnemonic } },
                                hre.config
                            )
                        ).toEqual({
                            port,
                            directory: resolve(hre.config.paths.root, directory),
                            overwriteAccounts,
                            anvil: {
                                host: '0.0.0.0',
                                port: 8545,
                                mnemonic,
                            },
                        })
                    }
                )
            )
        })


it('should work with anvil options', async () => {
            await fc.assert(
                fc.asyncProperty(anvilOptionsArbitrary, async (anvilOptions) => {
                    const spec = serializeDockerComposeSpec({
                        version: '3.9',
                        services: {
                            anvil: createEvmNodeServiceSpec(anvilOptions),
                        },
                    })

                    await writeFile(SPEC_FILE_PATH, spec)

                    const result = validateSpec()

                    expect(result.stderr.toString('utf8')).toBe('')
                    expect(result.status).toBe(0)
                }),
                { numRuns: 20 }
            )
        })


it('should work with anvil services', async () => {
            await fc.assert(
                fc.asyncProperty(portArbitrary, servicesArbitrary, async (port, services) => {
                    const spec = serializeDockerComposeSpec({
                        version: '3.9',
                        services: {
                            ...services,
                            rpc: createEvmNodeProxyServiceSpec(port, services),
                        },
                    })

                    await writeFile(SPEC_FILE_PATH, spec)

                    const result = validateSpec()

                    expect(result.stderr.toString('utf8')).toBe('')
                    expect(result.status).toBe(0)
                }),
                { numRuns: 20 }
            )
        })


it('should work goddammit', async () => {
            await fc.assert(
                fc.asyncProperty(portArbitrary, anvilOptionsRecordArbitrary, async (port, anvilOptions) => {
                    const simulationConfig = resolveSimulationConfig({ port }, hre.config)
                    const spec = serializeDockerComposeSpec(createSimulationComposeSpec(simulationConfig, anvilOptions))

                    await writeFile(SPEC_FILE_PATH, spec)

                    const result = validateSpec()

                    expect(result.stderr.toString('utf8')).toBe('')
                    expect(result.status).toBe(0)
                }),
                { numRuns: 20 }
            )
        })


it('should pass the original value if contract is already an OmniPoint', async () => {
            await fc.assert(
                fc.asyncProperty(pointArbitrary, async (point) => {
                    const contractFactory = jest.fn().mockRejectedValue('Oh no')
                    const transformer = createOmniPointHardhatTransformer(contractFactory)

                    const transformed = await transformer(point)

                    expect(transformed).toBe(point)
                    expect(contractFactory).not.toHaveBeenCalled()
                })
            )
        })


it('should call the contractFactory if contract is not an OmniPoint', async () => {
            await fc.assert(
                fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {
                    fc.pre(!isOmniPoint(point))

                    const contract = new Contract(address, [])
                    const contractFactory = jest
                        .fn()
                        .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))
                    const transformer = createOmniPointHardhatTransformer(contractFactory)

                    const transformed = await transformer(point)

                    expect(transformed).toEqual({ ...point, address })
                    expect(contractFactory).toHaveBeenCalledTimes(1)
                    expect(contractFactory).toHaveBeenCalledWith(point)
                })
            )
        })


it('should add the contractName if point is not an OmniPoint', async () => {
            await fc.assert(
                fc.asyncProperty(pointHardhatArbitrary, evmAddressArbitrary, async (point, address) => {
                    fc.pre(!isOmniPoint(point))

                    const contract = new Contract(address, [])
                    const contractFactory = jest
                        .fn()
                        .mockImplementation(async (point: OmniPointHardhat) => ({ eid: point.eid, contract }))
                    const transformer = createOmniPointHardhatTransformer(contractFactory)

                    const transformed = await transformer(point)

                    expect(transformed).toEqual({ eid: point.eid, address, contractName: point.contractName })
                    expect(contractFactory).toHaveBeenCalledTimes(1)
                    expect(contractFactory).toHaveBeenCalledWith(point)
                })
            )
        })


it('should call the pointTransformer on the point', async () => {
            await fc.assert(
                fc.asyncProperty(
                    pointHardhatArbitrary,
                    evmAddressArbitrary,
                    fc.anything(),
                    async (point, address, config) => {
                        fc.pre(!isOmniPoint(point))

                        const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({
                            eid: point.eid,
                            address: address,
                        }))
                        const transformer = createOmniNodeHardhatTransformer(pointTransformer)

                        const node = await transformer({ contract: point, config })

                        expect(node).toEqual({ point: { eid: point.eid, address }, config })
                        expect(pointTransformer).toHaveBeenCalledTimes(1)
                        expect(pointTransformer).toHaveBeenCalledWith(point)
                    }
                )
            )
        })


it('should call the pointTransformer on from and to', async () => {
            await fc.assert(
                fc.asyncProperty(
                    pointHardhatArbitrary,
                    pointHardhatArbitrary,
                    evmAddressArbitrary,
                    fc.anything(),
                    async (from, to, address, config) => {
                        const pointTransformer = jest.fn().mockImplementation(async (point: OmniPointHardhat) => ({
                            eid: point.eid,
                            address,
                        }))
                        const transformer = createOmniEdgeHardhatTransformer(pointTransformer)

                        const edge = await transformer({ from, to, config })

                        expect(edge).toEqual({
                            vector: { from: { eid: from.eid, address }, to: { eid: to.eid, address } },
                            config,
                        })
                        expect(pointTransformer).toHaveBeenCalledTimes(2)
                        expect(pointTransformer).toHaveBeenCalledWith(from)
                        expect(pointTransformer).toHaveBeenCalledWith(to)
                    }
                )
            )
        })


it('should call the nodeTransformer and edgeTransformer for every node and edge and return the result', async () => {
            await fc.assert(
                fc.asyncProperty(
                    fc.array(nodeHardhatArbitrary),
                    fc.array(edgeHardhatArbitrary),
                    async (contracts, connections) => {
                        const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))
                        const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))
                        const transformer = createOmniGraphHardhatTransformer(nodeTransformer, edgeTransformer)

                        const graph = await transformer({ contracts, connections })

                        expect(graph.contracts).toEqual(contracts.map((node) => ({ node })))
                        expect(graph.connections).toEqual(connections.map((edge) => ({ edge })))
                    }
                )
            )
        })


it('should support sequential applicative', async () => {
            await fc.assert(
                fc.asyncProperty(
                    fc.array(nodeHardhatArbitrary),
                    fc.array(edgeHardhatArbitrary),
                    async (contracts, connections) => {
                        const nodeTransformer = jest.fn().mockImplementation(async (node) => ({ node }))
                        const edgeTransformer = jest.fn().mockImplementation(async (edge) => ({ edge }))
                        const transformerSequential = createOmniGraphHardhatTransformer(
                            nodeTransformer,
                            edgeTransformer,
                            sequence
                        )
                        const transformerParallel = createOmniGraphHardhatTransformer(
                            nodeTransformer,
                            edgeTransformer,
                            parallel
                        )

                        const graphSequential = await transformerSequential({ contracts, connections })
                        const graphParallel = await transformerParallel({ contracts, connections })

                        expect(graphSequential).toEqual(graphParallel)
                    }
                )
            )
        })


it('should just work', () => {
            fc.assert(
                fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {
                    const omniDeployment: OmniDeployment = { eid, deployment: { address } as Deployment }

                    expect(omniDeploymentToPoint(omniDeployment)).toEqual({ eid, address })
                })
            )
        })


it('should just work', () => {
            fc.assert(
                fc.property(endpointArbitrary, evmAddressArbitrary, (eid, address) => {
                    const omniDeployment: OmniDeployment = { eid, deployment: { address, abi: [] } as Deployment }
                    const omniContract = omniDeploymentToContract(omniDeployment)

                    // chai is not great with deep equality on class instances so we need to compare the result property by property
                    expect(omniContract.eid).toBe(eid)
                    expect(omniContract.contract.address).toBe(address)
                    expect(omniContract.contract.interface.fragments).toEqual([])
                })
            )
        })


it('should fall back on getting the artifact based on the deployments if artifact not found', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, async (address) => {
                        const environmentFactory = createGetHreByEid(hre)
                        const contractFactory = createContractFactory(environmentFactory)

                        const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)
                        jest.spyOn(env.deployments, 'getArtifact').mockRejectedValue(new Error(`oh no`))
                        jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([
                            {
                                address,
                                abi: [],
                            },
                        ])

                        // Then check whether the factory will get it for us
                        const deployment = await contractFactory({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            address,
                            contractName: 'MyContract',
                        })

                        expect(deployment).toEqual({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            contract: expect.any(Contract),
                        })
                        expect(env.deployments.getArtifact).toHaveBeenCalledWith('MyContract')
                        expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)
                    })
                )
            })


it('should reject when eid does not exist', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, async (address) => {
                        const contractFactory = createContractFactory()

                        await expect(() =>
                            contractFactory({ eid: EndpointId.CANTO_TESTNET, address })
                        ).rejects.toBeTruthy()
                    })
                )
            })


it('should reject when contract has not been deployed', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, async (address) => {
                        const contractFactory = createContractFactory()

                        await expect(() =>
                            contractFactory({ eid: EndpointId.ETHEREUM_V2_MAINNET, address })
                        ).rejects.toThrow(/Could not find a deployment for address/)
                    })
                )
            })


it('should resolve when there is only one deployment for the contract', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, async (address) => {
                        const environmentFactory = createGetHreByEid(hre)
                        const contractFactory = createContractFactory(environmentFactory)

                        const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)
                        jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([
                            {
                                address,
                                abi: [],
                            },
                        ])

                        // Then check whether the factory will get it for us
                        const deployment = await contractFactory({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            address,
                        })

                        expect(deployment).toEqual({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            contract: expect.any(Contract),
                        })
                        expect(env.deployments.getDeploymentsFromAddress).toHaveBeenCalledWith(address)
                    })
                )
            })


it('should merge ABIs when there are multiple deployments with the same address (proxy deployments)', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, async (address) => {
                        const environmentFactory = createGetHreByEid(hre)
                        const contractFactory = createContractFactory(environmentFactory)

                        const env = await environmentFactory(EndpointId.ETHEREUM_V2_MAINNET)
                        jest.spyOn(env.deployments, 'getDeploymentsFromAddress').mockResolvedValue([
                            {
                                address,
                                abi: [
                                    { name: 'implementation', outputs: [], stateMutability: 'view', type: 'function' },
                                ],
                            },
                            {
                                address,
                                abi: [
                                    { name: 'contractMethod', outputs: [], stateMutability: 'view', type: 'function' },
                                ],
                            },
                        ])

                        // Then check whether the factory will get it for us
                        const omniContract = await contractFactory({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            address,
                        })

                        expect(omniContract).toEqual({
                            eid: EndpointId.ETHEREUM_V2_MAINNET,
                            contract: expect.any(Contract),
                        })
                        expect(omniContract.contract.implementation).toBeInstanceOf(Function)
                        expect(omniContract.contract.contractMethod).toBeInstanceOf(Function)
                    })
                )
            })


it('should reject if contractFactory rejects', async () => {
            await fc.assert(
                fc.asyncProperty(pointArbitrary, async (point) => {
                    const error = new Error()
                    const contractFactory = jest.fn().mockRejectedValue(error)
                    const connectedContractFactory = createConnectedContractFactory(contractFactory)

                    await expect(connectedContractFactory(point)).rejects.toBe(error)
                })
            )
        })


it('should reject if providerFactory rejects', async () => {
            await fc.assert(
                fc.asyncProperty(pointArbitrary, async (point) => {
                    const error = new Error()
                    const contractFactory = jest.fn().mockResolvedValue(new Contract(makeZeroAddress(undefined), []))
                    const providerFactory = jest.fn().mockRejectedValue(error)
                    const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)

                    await expect(connectedContractFactory(point)).rejects.toBe(error)
                })
            )
        })


it('should return a connected contract', async () => {
            await fc.assert(
                fc.asyncProperty(pointArbitrary, async (point) => {
                    const contract = new Contract(makeZeroAddress(undefined), [])
                    const provider = new JsonRpcProvider()
                    const contractFactory = jest.fn().mockResolvedValue({ eid: point.eid, contract })
                    const providerFactory = jest.fn().mockResolvedValue(provider)
                    const connectedContractFactory = createConnectedContractFactory(contractFactory, providerFactory)

                    const connectedOmniContract = await connectedContractFactory(point)

                    expect(connectedOmniContract.eid).toBe(point.eid)
                    expect(connectedOmniContract.contract).not.toBe(contract)
                    expect(connectedOmniContract.contract).toBeInstanceOf(Contract)
                    expect(connectedOmniContract.contract.provider).toBe(provider)
                })
            )
        })


it('should not throw if called with an array of networks defined in hardhat config', () => {
            fc.assert(
                fc.property(definedNetworksArrayArbitrary, (networks) => {
                    expect(assertDefinedNetworks(networks)).toBe(networks)
                })
            )
        })


it('should not throw if called with a Set of networks defined in hardhat config', () => {
            fc.assert(
                fc.property(definedNetworksSetArbitrary, (networks) => {
                    expect(assertDefinedNetworks(networks)).toBe(networks)
                })
            )
        })


it('should throw if called if a network has not been defined in an array', () => {
            fc.assert(
                fc.property(definedNetworksArrayArbitrary, fc.string(), (networks, network) => {
                    fc.pre(!definedNetworks.includes(network))

                    expect(() => assertDefinedNetworks([...networks, network])).toThrow()
                })
            )
        })


it('should throw if called if a network has not been defined in a Set', () => {
            fc.assert(
                fc.property(definedNetworksSetArbitrary, fc.string(), (networks, network) => {
                    fc.pre(!definedNetworks.includes(network))

                    expect(() => assertDefinedNetworks(networks.add(network))).toThrow()
                })
            )
        })


it('should throw if negative index is passed', () => {
            fc.assert(
                fc.property(fc.integer({ max: -1 }), (index) => {
                    expect(() => signer.parse('signer', String(index))).toThrow()
                })
            )
        })


it('should return the address if valid address is passed', () => {
            fc.assert(
                fc.property(evmAddressArbitrary, (address) => {
                    expect(signer.parse('signer', address)).toEqual({ type: 'address', address })
                })
            )
        })


it('should return the index if non-negative index is passed', () => {
            fc.assert(
                fc.property(fc.integer({ min: 0 }), (index) => {
                    expect(signer.parse('signer', String(index))).toEqual({ type: 'index', index })
                })
            )
        })


it('should parse all valid endpoint IDs', () => {
            fc.assert(
                fc.property(endpointArbitrary, (eid) => {
                    expect(types.eid.parse('eid', String(eid))).toEqual(eid)
                })
            )
        })


it('should parse all valid endpoint labels', () => {
            fc.assert(
                fc.property(endpointArbitrary, (eid) => {
                    expect(types.eid.parse('eid', EndpointId[eid]!)).toEqual(eid)
                })
            )
        })


it('should not parse invalid strings', () => {
            fc.assert(
                fc.property(fc.string(), (eid) => {
                    // We filter out the values that by any slim chance could be valid endpoint IDs
                    fc.pre(EndpointId[eid] == null)
                    fc.pre(EndpointId[parseInt(eid)] == null)

                    expect(() => types.eid.parse('eid', eid)).toThrow()
                })
            )
        })


it('should not parse invalid numbers', () => {
            fc.assert(
                fc.property(fc.integer(), (eid) => {
                    fc.pre(EndpointId[eid] == null)

                    expect(() => types.eid.parse('eid', String(eid))).toThrow()
                })
            )
        })


it('should reject if the eid of the transaction does not match the eid of the signer', async () => {
                await fc.assert(
                    fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {
                        fc.pre(eid !== transaction.point.eid)

                        const signer = {} as Signer
                        const omniSigner = new OmniSignerEVM(eid, signer)

                        await expect(() => omniSigner.sign(transaction)).rejects.toThrow(/Could not use signer/)
                    })
                )
            })


it('should sign the transaction using the signer if the eids match', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        transactionArbitrary,
                        signedTransactionArbitrary,
                        async (transaction, signedTransaction) => {
                            const signTransaction = jest.fn().mockResolvedValue(signedTransaction)
                            const signer = { signTransaction } as unknown as Signer
                            const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)

                            expect(await omniSigner.sign(transaction)).toBe(signedTransaction)
                            expect(signTransaction).toHaveBeenCalledWith({
                                to: transaction.point.address,
                                data: transaction.data,
                                value: transaction.value,
                            })
                        }
                    )
                )
            })


it('should reject if the eid of the transaction does not match the eid of the signer', async () => {
                await fc.assert(
                    fc.asyncProperty(endpointArbitrary, transactionArbitrary, async (eid, transaction) => {
                        fc.pre(eid !== transaction.point.eid)

                        const signer = {} as Signer
                        const omniSigner = new OmniSignerEVM(eid, signer)

                        await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(/Could not use signer/)
                    })
                )
            })


it('should send the transaction using the signer if the eids match', async () => {
                await fc.assert(
                    fc.asyncProperty(transactionArbitrary, transactionHashArbitrary, async (transaction, hash) => {
                        const sendTransaction = jest.fn().mockResolvedValue({ hash })
                        const signer = { sendTransaction } as unknown as Signer
                        const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)

                        expect(await omniSigner.signAndSend(transaction)).toEqual({ transactionHash: hash })
                        expect(sendTransaction).toHaveBeenCalledWith({
                            to: transaction.point.address,
                            data: transaction.data,
                            value: transaction.value,
                        })
                    })
                )
            })


it('should not be supported', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        evmAddressArbitrary,
                        endpointArbitrary,
                        transactionArbitrary,
                        async (safeAddress, eid, transaction) => {
                            const signer = {} as Signer

                            const apiKit = {
                                getNextNonce: jest.fn(),
                            } as unknown as SafeApiKit

                            const safe = {
                                createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),
                                getAddress: jest.fn().mockResolvedValue(safeAddress),
                                signTransaction: jest.fn().mockResolvedValue({ data: { data: '0xsigned' } }),
                            } as unknown as Safe

                            const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, apiKit, safe)

                            await expect(omniSigner.sign(transaction)).rejects.toThrow(
                                /Signing transactions with safe is currently not supported, use signAndSend instead/
                            )
                        }
                    )
                )
            })


it('should reject if the eid of the transaction does not match the eid of the signer', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        evmAddressArbitrary,
                        endpointArbitrary,
                        transactionArbitrary,
                        async (safeAddress, eid, transaction) => {
                            fc.pre(eid !== transaction.point.eid)

                            const signer = {} as Signer
                            const safe = {
                                createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),
                                getAddress: jest.fn().mockResolvedValue(safeAddress),
                                signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),
                            } as unknown as Safe
                            const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)

                            await expect(() => omniSigner.signAndSend(transaction)).rejects.toThrow(
                                /Could not use signer/
                            )
                        }
                    )
                )
            })


it('should send the transaction using the signer if the eids match', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        evmAddressArbitrary,
                        transactionArbitrary,
                        transactionHashArbitrary,
                        async (safeAddress, transaction, transactionHash) => {
                            const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer
                            const apiKit = {
                                proposeTransaction: jest.fn(),
                                getNextNonce: jest.fn(),
                            } as unknown as SafeApiKit
                            const safe = {
                                createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),
                                getTransactionHash: jest.fn().mockResolvedValue(transactionHash),
                                getAddress: jest.fn().mockResolvedValue(safeAddress),
                                signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),
                            } as unknown as Safe

                            const omniSigner = new GnosisOmniSignerEVM(
                                transaction.point.eid,
                                signer,
                                '',
                                {
                                    safeAddress,
                                },
                                undefined,
                                apiKit,
                                safe
                            )

                            const result = await omniSigner.signAndSend(transaction)
                            expect(result.transactionHash).toEqual(transactionHash)

                            expect(await result.wait()).toEqual({ transactionHash })

                            expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)
                            expect(apiKit.proposeTransaction).toHaveBeenCalledWith({
                                safeAddress,
                                safeTransactionData: 'transaction',
                                safeTxHash: transactionHash,
                                senderAddress: undefined,
                                senderSignature: 'signature',
                            })
                        }
                    )
                )
            })


it('should reject with no transactions', async () => {
                await fc.assert(
                    fc.asyncProperty(evmAddressArbitrary, endpointArbitrary, async (safeAddress, eid) => {
                        const signer = {} as Signer
                        const safe = {} as unknown as Safe
                        const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)

                        await expect(() => omniSigner.signAndSendBatch([])).rejects.toThrow(
                            /signAndSendBatch received 0 transactions/
                        )
                    })
                )
            })


it('should reject if at least one of the transaction eids do not match the signer eid', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        evmAddressArbitrary,
                        endpointArbitrary,
                        fc.array(transactionArbitrary, { minLength: 1 }),
                        async (safeAddress, eid, transactions) => {
                            fc.pre(transactions.some((transaction) => eid !== transaction.point.eid))

                            const signer = {} as Signer
                            const safe = {
                                createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),
                                getAddress: jest.fn().mockResolvedValue(safeAddress),
                                signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),
                            } as unknown as Safe
                            const omniSigner = new GnosisOmniSignerEVM(eid, signer, '', {}, undefined, undefined, safe)

                            await expect(() => omniSigner.signAndSendBatch(transactions)).rejects.toThrow(
                                /Could not use signer/
                            )
                        }
                    )
                )
            })


it('should send the transaction using the signer if the eids match', async () => {
                await fc.assert(
                    fc.asyncProperty(
                        evmAddressArbitrary,
                        endpointArbitrary,
                        fc.array(transactionArbitrary, { minLength: 1 }),
                        transactionHashArbitrary,
                        async (safeAddress, eid, transactions, transactionHash) => {
                            const nonce = 17
                            const signer = { getAddress: jest.fn(), sendTransaction: jest.fn() } as unknown as Signer
                            const apiKit = {
                                proposeTransaction: jest.fn(),
                                getNextNonce: jest.fn().mockResolvedValue(nonce),
                            } as unknown as SafeApiKit
                            const safe = {
                                createTransaction: jest.fn().mockResolvedValue({ data: 'transaction' }),
                                getTransactionHash: jest.fn().mockResolvedValue(transactionHash),
                                getAddress: jest.fn().mockResolvedValue(safeAddress),
                                signTransactionHash: jest.fn().mockResolvedValue({ data: 'signature' }),
                            } as unknown as Safe

                            const omniSigner = new GnosisOmniSignerEVM(
                                eid,
                                signer,
                                '',
                                {
                                    safeAddress,
                                },
                                undefined,
                                apiKit,
                                safe
                            )

                            const transactionsWithMatchingEids = transactions.map((t) => ({
                                ...t,
                                point: { ...t.point, eid },
                            }))

                            const result = await omniSigner.signAndSendBatch(transactionsWithMatchingEids)
                            expect(result.transactionHash).toEqual(transactionHash)

                            expect(await result.wait()).toEqual({ transactionHash })

                            expect(safe.createTransaction).toHaveBeenCalledWith({
                                safeTransactionData: transactions.map((t) => ({
                                    to: t.point.address,
                                    data: t.data,
                                    value: String(t.value ?? 0),
                                    operation: OperationType.Call,
                                })),
                                options: { nonce },
                            })

                            expect(apiKit.getNextNonce).toHaveBeenCalledWith(safeAddress)
                            expect(apiKit.proposeTransaction).toHaveBeenCalledWith({
                                safeAddress,
                                safeTransactionData: 'transaction',
                                safeTxHash: transactionHash,
                                senderAddress: undefined,
                                senderSignature: 'signature',
                            })
                        }
                    )
                )
            })


it('should not run tsc', async () => {
            await fc.assert(
                fc.asyncProperty(fc.oneof(fc.string(), fc.constantFrom(undefined)), async (env) => {
                    fc.pre(env !== 'production')

                    const plugin = createDeclarationBuild({ enabled: undefined })

                    await plugin.buildEnd.call(pluginContext)

                    expect(spawnSyncMock).not.toHaveBeenCalled()
                })
            )
        })


test('TINY-4773: AutoLink: multiple @ characters', (editor) => {
    fc.assert(fc.property(fc.hexaString(0, 30), fc.hexaString(0, 30), fc.hexaString(0, 30), (s1, s2, s3) => {
      assertNoLink(editor, `${s1}@@${s2}@.@${s3}`, `${s1}@@${s2}@.@${s3}`);
    }));
  })

Summary: Multiple '@' characters in a string should not trigger the creation of a link.


test('TINY-4773: AutoLink: ending in @ character', (editor) => {
    fc.assert(fc.property(fc.hexaString(0, 100), (s1) => {
      assertNoLink(editor, `${s1}@`, `${s1}@`);
    }));
  })

Summary: The property should ensure that a string ending with the "@" character does not trigger link creation in the editor.


UnitTest.test('KAssert.eqError: failure', () => {
  fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {
    Assert.throws('should throw if numbers differ #1', () => {
      KAssert.eqError('eq', a, Result.error(b));
    });
    Assert.throws('should throw if numbers differ #2', () => {
      KAssert.eqError('eq', a, Result.error(b), tBoom());
    });
    Assert.throws('should throw if numbers differ #2', () => {
      KAssert.eqError('eq', a, Result.error(b), tBoom(), tNumber);
    });
  }));

  fc.assert(fc.property(fc.integer(), fc.string(), (i, s) => {
    Assert.throws('should throw if value #1', () => {
      KAssert.eqError('eq', i, Result.value(s));
    });
    Assert.throws('should throw if value #2', () => {
      KAssert.eqError('eq', i, Result.value(s), tBoom());
    });
    Assert.throws('should throw if value #3', () => {
      KAssert.eqError('eq', i, Result.value(s), tBoom(), tBoom());
    });
  }));
})

Summary: `KAssert.eqError` throws an error when comparing differing numbers or when comparing an integer with a string wrapped in `Result.value`.


UnitTest.test('KAssert.eqValue: success', () => {
  fc.assert(fc.property(fc.integer(), (i) => {
    KAssert.eqValue('eq', i, Result.value(i));
    KAssert.eqValue('eq', i, Result.value(i), tNumber);
    KAssert.eqValue('eq', i, Result.value(i), tNumber, tBoom());
  }));
})

Summary: `KAssert.eqValue` confirms equality between an integer and a `Result.value` containing the same integer, optionally using `tNumber` and `tBoom` for additional type checking.


UnitTest.test('KAssert.eqSome: failure', () => {
  fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {
    Assert.throws('some(i) != some(!i) #1', () => {
      KAssert.eqSome('eq', a, Option.some(b));
    });
  }));
  fc.assert(fc.property(twoDifferentNumbers, ([ a, b ]) => {
    Assert.throws('some(i) != some(!i) #2', () => {
      KAssert.eqSome('eq', a, Option.some(b), tNumber);
    });
  }));
})

Summary: `KAssert.eqSome` throws an error when checking equality between a value and a different non-empty option.


UnitTest.test('KAssert.eqNone: failure', () => {
  fc.assert(fc.property(fc.integer(), (i) => {
    Assert.throws('some(i) != none', () => {
      KAssert.eqNone('eq', Option.some(i));
    });
  }));
})

Summary: `KAssert.eqNone` throws an error when comparing an `Option.some` value to `none`.