mirror of
https://github.com/logos-storage/nim-nitro.git
synced 2026-01-02 13:43:06 +00:00
There's a new byteutils in newer versions of stew - also, remove upraises and disable windows testing which requires SSL library install
19 lines
405 B
Nim
19 lines
405 B
Nim
import pkg/nimcrypto
|
|
import ../basics
|
|
import ./abi
|
|
|
|
{.push raises: [].}
|
|
|
|
export basics
|
|
|
|
type
|
|
ChannelDefinition* = object
|
|
nonce*: UInt48
|
|
participants*: seq[EthAddress]
|
|
chainId*: UInt256
|
|
|
|
func getChannelId*(channel: ChannelDefinition): Destination =
|
|
let encoding = AbiEncoder.encode:
|
|
(channel.chainId, channel.participants, channel.nonce)
|
|
Destination(keccak256.digest(encoding).data)
|