nim-dagger/codex/contracts/interactions/hostinteractions.nim
Jaremy Creechley e47b38af11
Improving proc/func formatting consistency (#454)
* Fixes/workarounds for nimsuggest failures in codex.nim.

* remove rng prefix - it appears to work now

* format new's to be more consistent

* making proc formatting a bit more consistent
2023-06-22 08:11:18 -07:00

36 lines
811 B
Nim

import pkg/ethers
import pkg/chronicles
import ../../sales
import ../../proving
import ./interactions
export sales
export proving
export chronicles
type
HostInteractions* = ref object of ContractInteractions
sales*: Sales
proving*: Proving
proc new*(
_: type HostInteractions,
clock: OnChainClock,
sales: Sales,
proving: Proving
): HostInteractions =
## Create a new HostInteractions instance
##
HostInteractions(clock: clock, sales: sales, proving: proving)
method start*(self: HostInteractions) {.async.} =
await procCall ContractInteractions(self).start()
await self.sales.start()
await self.proving.start()
method stop*(self: HostInteractions) {.async.} =
await self.sales.stop()
await self.proving.stop()
await procCall ContractInteractions(self).start()