mirror of
https://github.com/logos-storage/nim-nitro.git
synced 2026-01-03 14:13:09 +00:00
23 lines
509 B
Nim
23 lines
509 B
Nim
import pkg/nimcrypto
|
|
import ../basics
|
|
import ./abi
|
|
|
|
include questionable/errorban
|
|
|
|
export basics
|
|
|
|
type
|
|
ChannelDefinition* = object
|
|
nonce*: UInt48
|
|
participants*: seq[EthAddress]
|
|
chainId*: UInt256
|
|
|
|
func getChannelId*(channel: ChannelDefinition): Destination =
|
|
var encoder= AbiEncoder.init()
|
|
encoder.startTuple()
|
|
encoder.write(channel.chainId)
|
|
encoder.write(channel.participants)
|
|
encoder.write(channel.nonce)
|
|
encoder.finishTuple()
|
|
Destination(keccak256.digest(encoder.finish()).data)
|