From 9635f26b9006b90e5b24054a78bed49b3391e5a8 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Wed, 7 Apr 2021 16:53:00 +0200 Subject: [PATCH] Fix tests on 32 bit platforms --- tests/dagger/examples.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/dagger/examples.nim b/tests/dagger/examples.nim index 51ac75a4..e5d0cae2 100644 --- a/tests/dagger/examples.nim +++ b/tests/dagger/examples.nim @@ -10,10 +10,14 @@ proc example*(_: type UInt256): UInt256 = b = rand(byte) UInt256.fromBytes(bytes) +proc example*(_: type UInt48): UInt48 = + # workaround for https://github.com/nim-lang/Nim/issues/17670 + uint64.rand mod (UInt48.high + 1) + proc example*(_: type SignedState): SignedState = var wallet = Wallet.init(EthPrivateKey.random()) let hub, asset, receiver = EthAddress.example let chainId, amount = UInt256.example - let nonce = UInt48.rand() + let nonce = UInt48.example let channel = wallet.openLedgerChannel(hub, chainId, nonce, asset, amount).get wallet.pay(channel, asset, receiver, amount).get