nim-nitro/nitro/protocol/channel.nim
Jacek Sieka a15660f70f
chore: fix import conflict
There's a new byteutils in newer versions of stew - also, remove
upraises and disable windows testing which requires SSL library install
2025-12-10 22:06:29 +01:00

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)