Skip to content

Commit

Permalink
Mark constants as Final
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoura committed Jun 27, 2023
1 parent ff5a2a4 commit d163579
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions cardano_clusterlib/consts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
DEFAULT_COIN = "lovelace"
MAINNET_MAGIC = 764824073
import typing as tp

DEFAULT_COIN: tp.Final[str] = "lovelace"
MAINNET_MAGIC: tp.Final[int] = 764824073

# offset of slots from Byron configuration vs current era configuration
SLOTS_OFFSETS = {
SLOTS_OFFSETS: tp.Final[tp.Dict[int, int]] = {
764824073: 85363200, # mainnet
1097911063: 30369600, # testnet
1: 1641600, # preprod
Expand All @@ -14,34 +16,34 @@
# For example, the command `cardano-cli query tx-mempool --cardano-mode info`
# has the following arguments:
# ["query", "tx-mempool", "--cardano-mode", SUBCOMMAND_MARK, "info"]
SUBCOMMAND_MARK = "SUBCOMMAND"
SUBCOMMAND_MARK: tp.Final[str] = "SUBCOMMAND"


class Protocols:
CARDANO = "cardano"
SHELLEY = "shelley"
CARDANO: tp.Final[str] = "cardano"
SHELLEY: tp.Final[str] = "shelley"


class Eras:
SHELLEY = "shelley"
ALLEGRA = "allegra"
MARY = "mary"
ALONZO = "alonzo"
SHELLEY: tp.Final[str] = "shelley"
ALLEGRA: tp.Final[str] = "allegra"
MARY: tp.Final[str] = "mary"
ALONZO: tp.Final[str] = "alonzo"


class MultiSigTypeArgs:
ALL = "all"
ANY = "any"
AT_LEAST = "atLeast"
ALL: tp.Final[str] = "all"
ANY: tp.Final[str] = "any"
AT_LEAST: tp.Final[str] = "atLeast"


class MultiSlotTypeArgs:
BEFORE = "before"
AFTER = "after"
BEFORE: tp.Final[str] = "before"
AFTER: tp.Final[str] = "after"


class ScriptTypes:
SIMPLE_V1 = "simple_v1"
SIMPLE_V2 = "simple_v2"
PLUTUS_V1 = "plutus_v1"
PLUTUS_V2 = "plutus_v2"
SIMPLE_V1: tp.Final[str] = "simple_v1"
SIMPLE_V2: tp.Final[str] = "simple_v2"
PLUTUS_V1: tp.Final[str] = "plutus_v1"
PLUTUS_V2: tp.Final[str] = "plutus_v2"

0 comments on commit d163579

Please sign in to comment.