mirror of
https://github.com/logos-storage/nim-nitro.git
synced 2026-01-07 08:03:14 +00:00
19 lines
407 B
Nim
19 lines
407 B
Nim
import pkg/nimcrypto
|
|
import ../basics
|
|
import ./abi
|
|
|
|
push: {.upraises:[].}
|
|
|
|
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)
|