From c57ecde046d59a4897d4bcf2e3c6203d858186f3 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 10 May 2021 09:42:38 +0200 Subject: [PATCH] Update to version 0.9.1 of questionable --- dagger.nimble | 2 +- dagger/bitswap/protobuf/payments.nim | 7 +++---- dagger/bitswap/protobuf/presence.nim | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dagger.nimble b/dagger.nimble index 7bbaf533..c7d345ca 100644 --- a/dagger.nimble +++ b/dagger.nimble @@ -14,6 +14,6 @@ requires "nim >= 1.2.6", "stew#head", "protobufserialization >= 0.2.0 & < 0.3.0", "https://github.com/status-im/nim-nitro >= 0.4.0 & < 0.5.0", - "questionable >= 0.7.0 & < 0.8.0", + "questionable >= 0.9.1 & < 0.10.0", "upraises >= 0.1.0 & < 0.2.0", "asynctest >= 0.2.1 & < 0.3.0" diff --git a/dagger/bitswap/protobuf/payments.nim b/dagger/bitswap/protobuf/payments.nim index 0c464eb5..e01706e3 100644 --- a/dagger/bitswap/protobuf/payments.nim +++ b/dagger/bitswap/protobuf/payments.nim @@ -39,11 +39,10 @@ func parse(_: type UInt256, bytes: seq[byte]): ?UInt256 = UInt256.fromBytesBE(bytes).some func init*(_: type Pricing, message: PricingMessage): ?Pricing = - let address = EthAddress.parse(message.address) - let price = UInt256.parse(message.price) - if address.isNone or price.isNone: + without address =? EthAddress.parse(message.address) and + price =? UInt256.parse(message.price): return Pricing.none - Pricing(address: address.get, price: price.get).some + Pricing(address: address, price: price).some func init*(_: type StateChannelUpdate, state: SignedState): StateChannelUpdate = StateChannelUpdate(update: state.toJson.toBytes) diff --git a/dagger/bitswap/protobuf/presence.nim b/dagger/bitswap/protobuf/presence.nim index a51a4a1f..682ca9aa 100644 --- a/dagger/bitswap/protobuf/presence.nim +++ b/dagger/bitswap/protobuf/presence.nim @@ -31,8 +31,6 @@ func parse(_: type UInt256, bytes: seq[byte]): ?UInt256 = UInt256.fromBytesBE(bytes).some func init*(_: type Presence, message: PresenceMessage): ?Presence = - mixin parsedCid, parsedPrice - without parsedCid =? Cid.init(message.cid): return none Presence