fix YAML parsed list of ints

This commit is contained in:
Danny Ryan 2020-02-28 12:27:00 -06:00
parent 9718d206a7
commit 63687e6f34
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
3 changed files with 4 additions and 3 deletions

View File

@ -179,7 +179,7 @@ MAX_SHARD_BLOCK_CHUNKS: 4
# 3 * 2**16` (= 196,608) # 3 * 2**16` (= 196,608)
TARGET_SHARD_BLOCK_SIZE: 196608 TARGET_SHARD_BLOCK_SIZE: 196608
# Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length. # Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length.
# SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233] SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
# len(SHARD_BLOCK_OFFSETS) # len(SHARD_BLOCK_OFFSETS)
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12 MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei # 2**14 (= 16,384) Gwei

View File

@ -180,7 +180,7 @@ MAX_SHARD_BLOCK_CHUNKS: 4
# 3 * 2**16` (= 196,608) # 3 * 2**16` (= 196,608)
TARGET_SHARD_BLOCK_SIZE: 196608 TARGET_SHARD_BLOCK_SIZE: 196608
# Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length. # Note: MAX_SHARD_BLOCKS_PER_ATTESTATION is derived from the list length.
# SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233] SHARD_BLOCK_OFFSETS: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
# len(SHARD_BLOCK_OFFSETS) # len(SHARD_BLOCK_OFFSETS)
MAX_SHARD_BLOCKS_PER_ATTESTATION: 12 MAX_SHARD_BLOCKS_PER_ATTESTATION: 12
# 2**14 (= 16,384) Gwei # 2**14 (= 16,384) Gwei

View File

@ -36,7 +36,8 @@ def load_config_file(configs_dir, presets_name) -> Dict[str, Any]:
out = dict() out = dict()
for k, v in loaded.items(): for k, v in loaded.items():
if isinstance(v, list): if isinstance(v, list):
out[k] = v # Clean up integer values. YAML parser renders lists of ints as list of str
out[k] = [int(item) if item.isdigit() else item for item in v]
elif isinstance(v, str) and v.startswith("0x"): elif isinstance(v, str) and v.startswith("0x"):
out[k] = bytes.fromhex(v[2:]) out[k] = bytes.fromhex(v[2:])
else: else: