mirror of
https://github.com/logos-storage/nim-nitro.git
synced 2026-01-03 22:23:10 +00:00
19 lines
386 B
Nim
19 lines
386 B
Nim
import pkg/nimcrypto
|
|
import ./abi
|
|
import ./types
|
|
|
|
export types
|
|
|
|
type
|
|
Channel* = object
|
|
nonce*: UInt48
|
|
participants*: seq[EthAddress]
|
|
chainId*: UInt256
|
|
|
|
proc getChannelId*(channel: Channel): array[32, byte] =
|
|
var writer: AbiWriter
|
|
writer.write(channel.chainId)
|
|
writer.write(channel.participants)
|
|
writer.write(channel.nonce)
|
|
keccak256.digest(writer.finish()).data
|