Update to version 0.9.1 of questionable
This commit is contained in:
parent
0e34b69d7d
commit
c57ecde046
|
@ -14,6 +14,6 @@ requires "nim >= 1.2.6",
|
||||||
"stew#head",
|
"stew#head",
|
||||||
"protobufserialization >= 0.2.0 & < 0.3.0",
|
"protobufserialization >= 0.2.0 & < 0.3.0",
|
||||||
"https://github.com/status-im/nim-nitro >= 0.4.0 & < 0.5.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",
|
"upraises >= 0.1.0 & < 0.2.0",
|
||||||
"asynctest >= 0.2.1 & < 0.3.0"
|
"asynctest >= 0.2.1 & < 0.3.0"
|
||||||
|
|
|
@ -39,11 +39,10 @@ func parse(_: type UInt256, bytes: seq[byte]): ?UInt256 =
|
||||||
UInt256.fromBytesBE(bytes).some
|
UInt256.fromBytesBE(bytes).some
|
||||||
|
|
||||||
func init*(_: type Pricing, message: PricingMessage): ?Pricing =
|
func init*(_: type Pricing, message: PricingMessage): ?Pricing =
|
||||||
let address = EthAddress.parse(message.address)
|
without address =? EthAddress.parse(message.address) and
|
||||||
let price = UInt256.parse(message.price)
|
price =? UInt256.parse(message.price):
|
||||||
if address.isNone or price.isNone:
|
|
||||||
return Pricing.none
|
return Pricing.none
|
||||||
Pricing(address: address.get, price: price.get).some
|
Pricing(address: address, price: price).some
|
||||||
|
|
||||||
func init*(_: type StateChannelUpdate, state: SignedState): StateChannelUpdate =
|
func init*(_: type StateChannelUpdate, state: SignedState): StateChannelUpdate =
|
||||||
StateChannelUpdate(update: state.toJson.toBytes)
|
StateChannelUpdate(update: state.toJson.toBytes)
|
||||||
|
|
|
@ -31,8 +31,6 @@ func parse(_: type UInt256, bytes: seq[byte]): ?UInt256 =
|
||||||
UInt256.fromBytesBE(bytes).some
|
UInt256.fromBytesBE(bytes).some
|
||||||
|
|
||||||
func init*(_: type Presence, message: PresenceMessage): ?Presence =
|
func init*(_: type Presence, message: PresenceMessage): ?Presence =
|
||||||
mixin parsedCid, parsedPrice
|
|
||||||
|
|
||||||
without parsedCid =? Cid.init(message.cid):
|
without parsedCid =? Cid.init(message.cid):
|
||||||
return none Presence
|
return none Presence
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue