status-lib/status/types/permission.nim
Anthony Laibe c7722cda00
refactor: Group profile function and eth function together (#67)
* refactor: Group profile function and eth function together

* refactor: group eth backend

* refactor: Move various eth call to eth backend

* refactor: move accounts call to account backend

* refactor: permission
2021-10-01 12:53:38 -04:00

24 lines
456 B
Nim

import sets
import strutils
import chronicles
logScope:
topics = "permission-type"
type
Permission* {.pure.} = enum
Web3 = "web3",
ContactCode = "contact-code"
Unknown = "unknown"
type Dapp* = object
name*: string
permissions*: HashSet[Permission]
proc toPermission*(value: string): Permission =
result = Permission.Unknown
try:
result = parseEnum[Permission](value)
except:
warn "Unknown permission requested", value