Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename data gas to blob gas #1659

Merged
merged 8 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename ConfigurationError to ValueError
  • Loading branch information
jangko committed Aug 4, 2023
commit ac900433377a8d15367272e8f986b0dab6408a70
20 changes: 10 additions & 10 deletions fluffy/conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -239,51 +239,51 @@ func completeCmdArg*(T: type TrustedDigest, input: string): seq[string] =
return @[]

proc parseCmdArg*(T: type enr.Record, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
if not fromURI(result, p):
raise newException(ConfigurationError, "Invalid ENR")
raise newException(ValueError, "Invalid ENR")

proc completeCmdArg*(T: type enr.Record, val: string): seq[string] =
return @[]

proc parseCmdArg*(T: type Node, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
var record: enr.Record
if not fromURI(record, p):
raise newException(ConfigurationError, "Invalid ENR")
raise newException(ValueError, "Invalid ENR")

let n = newNode(record)
if n.isErr:
raise newException(ConfigurationError, $n.error)
raise newException(ValueError, $n.error)

if n[].address.isNone():
raise newException(ConfigurationError, "ENR without address")
raise newException(ValueError, "ENR without address")

n[]

proc completeCmdArg*(T: type Node, val: string): seq[string] =
return @[]

proc parseCmdArg*(T: type PrivateKey, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
try:
result = PrivateKey.fromHex(p).tryGet()
except CatchableError:
raise newException(ConfigurationError, "Invalid private key")
raise newException(ValueError, "Invalid private key")

proc completeCmdArg*(T: type PrivateKey, val: string): seq[string] =
return @[]

proc parseCmdArg*(T: type ClientConfig, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
let uri = parseUri(p)
if (uri.scheme == "http" or uri.scheme == "https"):
getHttpClientConfig(p)
elif (uri.scheme == "ws" or uri.scheme == "wss"):
getWebSocketClientConfig(p)
else:
raise newException(
ConfigurationError, "Proxy uri should have defined scheme (http/https/ws/wss)"
ValueError, "Proxy uri should have defined scheme (http/https/ws/wss)"
)

proc completeCmdArg*(T: type ClientConfig, val: string): seq[string] =
Expand Down
10 changes: 5 additions & 5 deletions fluffy/network/wire/portal_protocol_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ proc init*(
)

proc parseCmdArg*(T: type RadiusConfig, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
if p.startsWith("dynamic") and len(p) == 7:
RadiusConfig(kind: Dynamic)
elif p.startsWith("static:"):
Expand All @@ -64,11 +64,11 @@ proc parseCmdArg*(T: type RadiusConfig, p: string): T
uint16.parseCmdArg(num)
except ValueError:
let msg = "Provided logRadius: " & num & " is not a valid number"
raise newException(ConfigurationError, msg)
raise newException(ValueError, msg)

if parsed > 256:
raise newException(
ConfigurationError, "Provided logRadius should be <= 256"
ValueError, "Provided logRadius should be <= 256"
)

RadiusConfig(kind: Static, logRadius: parsed)
Expand All @@ -80,11 +80,11 @@ proc parseCmdArg*(T: type RadiusConfig, p: string): T
let msg =
"Not supported radius config option: " & p & " . " &
"Supported options: dynamic and static:logRadius"
raise newException(ConfigurationError, msg)
raise newException(ValueError, msg)

if parsed > 256:
raise newException(
ConfigurationError, "Provided logRadius should be <= 256")
ValueError, "Provided logRadius should be <= 256")

RadiusConfig(kind: Static, logRadius: parsed)

Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ type BeaconBridgeConf* = object
name: "direct-peer" .}: seq[string]

proc parseCmdArg*(
T: type Web3Url, p: string): T {.raises: [ConfigurationError].} =
T: type Web3Url, p: string): T {.raises: [ValueError].} =
let
url = parseUri(p)
normalizedScheme = url.scheme.toLowerAscii()
Expand All @@ -181,7 +181,7 @@ proc parseCmdArg*(
Web3Url(kind: WsUrl, web3Url: p)
else:
raise newException(
ConfigurationError,
ValueError,
"The Web3 URL must specify one of following protocols: http/https/ws/wss"
)

Expand Down
4 changes: 2 additions & 2 deletions fluffy/tools/blockwalk.nim
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ type
name: "block-hash" .}: Hash256

proc parseCmdArg*(T: type Hash256, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
var hash: Hash256
try:
hexToByteArray(p, hash.data)
except ValueError:
raise newException(ConfigurationError, "Invalid Hash256")
raise newException(ValueError, "Invalid Hash256")

return hash

Expand Down
8 changes: 4 additions & 4 deletions fluffy/tools/eth_data_exporter/exporter_conf.nim
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ type
discard

proc parseCmdArg*(
T: type Web3Url, p: string): T {.raises: [ConfigurationError].} =
T: type Web3Url, p: string): T {.raises: [ValueError].} =
let
url = parseUri(p)
normalizedScheme = url.scheme.toLowerAscii()
Expand All @@ -195,22 +195,22 @@ proc parseCmdArg*(
Web3Url(kind: WsUrl, url: p)
else:
raise newException(
ConfigurationError,
ValueError,
"The Web3 URL must specify one of following protocols: http/https/ws/wss"
)

proc completeCmdArg*(T: type Web3Url, val: string): seq[string] =
return @[]

proc parseCmdArg*(T: type StorageMode, p: string): T
{.raises: [ConfigurationError].} =
{.raises: [ValueError].} =
if p == "db":
return DbStorage
elif p == "json":
return JsonStorage
else:
let msg = "Provided mode: " & p & " is not a valid. Should be `json` or `db`"
raise newException(ConfigurationError, msg)
raise newException(ValueError, msg)

proc completeCmdArg*(T: type StorageMode, val: string): seq[string] =
return @[]
Expand Down
12 changes: 6 additions & 6 deletions fluffy/tools/portalcli.nim
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,22 @@ type

proc parseCmdArg*(T: type enr.Record, p: string): T =
if not fromURI(result, p):
raise newException(ConfigurationError, "Invalid ENR")
raise newException(ValueError, "Invalid ENR")

proc completeCmdArg*(T: type enr.Record, val: string): seq[string] =
return @[]

proc parseCmdArg*(T: type Node, p: string): T =
var record: enr.Record
if not fromURI(record, p):
raise newException(ConfigurationError, "Invalid ENR")
raise newException(ValueError, "Invalid ENR")

let n = newNode(record)
if n.isErr:
raise newException(ConfigurationError, $n.error)
raise newException(ValueError, $n.error)

if n[].address.isNone():
raise newException(ConfigurationError, "ENR without address")
raise newException(ValueError, "ENR without address")

n[]

Expand All @@ -169,7 +169,7 @@ proc parseCmdArg*(T: type PrivateKey, p: string): T =
try:
result = PrivateKey.fromHex(p).tryGet()
except CatchableError:
raise newException(ConfigurationError, "Invalid private key")
raise newException(ValueError, "Invalid private key")

proc completeCmdArg*(T: type PrivateKey, val: string): seq[string] =
return @[]
Expand All @@ -178,7 +178,7 @@ proc parseCmdArg*(T: type PortalProtocolId, p: string): T =
try:
result = byteutils.hexToByteArray(p, 2)
except ValueError:
raise newException(ConfigurationError,
raise newException(ValueError,
"Invalid protocol id, not a valid hex value")

proc completeCmdArg*(T: type PortalProtocolId, val: string): seq[string] =
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-blscurve
Submodule nim-blscurve updated 1 files
+1 −1 vendor/blst