Skip to content

Commit 55fc559

Browse files
committed
Change RLP sedes name from int to uint
1 parent cb0a2bb commit 55fc559

File tree

11 files changed

+48
-48
lines changed

11 files changed

+48
-48
lines changed

eth/beacon/types/attestation_records.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
)
1414

1515
from eth.rlp.sedes import (
16-
int16,
17-
int64,
18-
int256,
16+
uint16,
17+
uint64,
18+
uint256,
1919
hash32,
2020
)
2121

@@ -26,9 +26,9 @@ class AttestationRecord(rlp.Serializable):
2626
"""
2727
fields = [
2828
# Slot number
29-
('slot', int64),
29+
('slot', uint64),
3030
# Shard ID
31-
('shard_id', int16),
31+
('shard_id', uint16),
3232
# List of block hashes that this signature is signing over that
3333
# are NOT part of the current chain, in order of oldest to newest
3434
('oblique_parent_hashes', CountableList(hash32)),
@@ -37,10 +37,10 @@ class AttestationRecord(rlp.Serializable):
3737
# Who is participating
3838
('attester_bitfield', binary),
3939
# Last justified block
40-
('justified_slot', int64),
40+
('justified_slot', uint64),
4141
('justified_block_hash', hash32),
4242
# The actual signature
43-
('aggregate_sig', CountableList(int256)),
43+
('aggregate_sig', CountableList(uint256)),
4444
]
4545

4646
def __init__(self,

eth/beacon/types/blocks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ZERO_HASH32,
2020
)
2121
from eth.rlp.sedes import (
22-
int64,
22+
uint64,
2323
hash32,
2424
)
2525

@@ -31,7 +31,7 @@ class BaseBeaconBlock(rlp.Serializable):
3131
# Hash of the parent block
3232
('parent_hash', hash32),
3333
# Slot number (for the PoS mechanism)
34-
('slot_number', int64),
34+
('slot_number', uint64),
3535
# Randao commitment reveal
3636
('randao_reveal', hash32),
3737
# Attestations

eth/beacon/types/crosslink_records.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import rlp
55

66
from eth.rlp.sedes import (
7-
int64,
7+
uint64,
88
hash32,
99
)
1010

@@ -15,9 +15,9 @@ class CrosslinkRecord(rlp.Serializable):
1515
"""
1616
fields = [
1717
# What dynasty the crosslink was submitted in
18-
('dynasty', int64),
18+
('dynasty', uint64),
1919
# slot during which crosslink was added
20-
('slot', int64),
20+
('slot', uint64),
2121
# The block hash
2222
('hash', hash32),
2323
]

eth/beacon/types/crystallized_states.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
)
1717

1818
from eth.rlp.sedes import (
19-
int64,
19+
uint64,
2020
hash32,
2121
)
2222
from eth.utils.blake import (
@@ -39,25 +39,25 @@ class CrystallizedState(rlp.Serializable):
3939
# List of validators
4040
('validators', CountableList(ValidatorRecord)),
4141
# Last CrystallizedState recalculation
42-
('last_state_recalc', int64),
42+
('last_state_recalc', uint64),
4343
# What active validators are part of the attester set
4444
# at what height, and in what shard. Starts at slot
4545
# last_state_recalc - CYCLE_LENGTH
4646
('shard_and_committee_for_slots', CountableList(CountableList(ShardAndCommittee))),
4747
# The last justified slot
48-
('last_justified_slot', int64),
48+
('last_justified_slot', uint64),
4949
# Number of consecutive justified slots ending at this one
50-
('justified_streak', int64),
50+
('justified_streak', uint64),
5151
# The last finalized slot
52-
('last_finalized_slot', int64),
52+
('last_finalized_slot', uint64),
5353
# The current dynasty
54-
('current_dynasty', int64),
54+
('current_dynasty', uint64),
5555
# Records about the most recent crosslink for each shard
5656
('crosslink_records', CountableList(CrosslinkRecord)),
5757
# Used to select the committees for each shard
5858
('dynasty_seed', hash32),
5959
# start of the current dynasty
60-
('dynasty_start', int64),
60+
('dynasty_start', uint64),
6161
]
6262

6363
def __init__(self,

eth/beacon/types/shard_and_committees.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
)
99

1010
from eth.rlp.sedes import (
11-
int16,
12-
int24,
11+
uint16,
12+
uint24,
1313
)
1414

1515

@@ -19,9 +19,9 @@ class ShardAndCommittee(rlp.Serializable):
1919
"""
2020
fields = [
2121
# The shard ID
22-
('shard_id', int16),
22+
('shard_id', uint16),
2323
# Validator indices
24-
('committee', CountableList(int24)),
24+
('committee', CountableList(uint24)),
2525
]
2626

2727
def __init__(self,

eth/beacon/types/validator_records.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
from eth.rlp.sedes import (
88
address,
9-
int16,
10-
int64,
11-
int128,
12-
int256,
9+
uint16,
10+
uint64,
11+
uint128,
12+
uint256,
1313
hash32,
1414
)
1515

@@ -20,19 +20,19 @@ class ValidatorRecord(rlp.Serializable):
2020
"""
2121
fields = [
2222
# The validator's public key
23-
('pubkey', int256),
23+
('pubkey', uint256),
2424
# What shard the validator's balance will be sent to after withdrawal
25-
('withdrawal_shard', int16),
25+
('withdrawal_shard', uint16),
2626
# And what address
2727
('withdrawal_address', address),
2828
# The validator's current RANDAO beacon commitment
2929
('randao_commitment', hash32),
3030
# Current balance
31-
('balance', int128),
31+
('balance', uint128),
3232
# Dynasty where the validator is inducted
33-
('start_dynasty', int64),
33+
('start_dynasty', uint64),
3434
# Dynasty where the validator leaves
35-
('end_dynasty', int64),
35+
('end_dynasty', uint64),
3636
]
3737

3838
def __init__(self,

eth/rlp/headers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from .sedes import (
4141
address,
4242
hash32,
43-
int256,
43+
uint256,
4444
trie_root,
4545
)
4646

@@ -53,7 +53,7 @@ class MiningHeader(rlp.Serializable):
5353
('state_root', trie_root),
5454
('transaction_root', trie_root),
5555
('receipt_root', trie_root),
56-
('bloom', int256),
56+
('bloom', uint256),
5757
('difficulty', big_endian_int),
5858
('block_number', big_endian_int),
5959
('gas_limit', big_endian_int),
@@ -74,7 +74,7 @@ class BlockHeader(rlp.Serializable):
7474
('state_root', trie_root),
7575
('transaction_root', trie_root),
7676
('receipt_root', trie_root),
77-
('bloom', int256),
77+
('bloom', uint256),
7878
('difficulty', big_endian_int),
7979
('block_number', big_endian_int),
8080
('gas_limit', big_endian_int),

eth/rlp/logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
from .sedes import (
1313
address,
14-
int32,
14+
uint32,
1515
)
1616

1717

1818
class Log(rlp.Serializable):
1919
fields = [
2020
('address', address),
21-
('topics', CountableList(int32)),
21+
('topics', CountableList(uint32)),
2222
('data', binary)
2323
]
2424

@@ -30,5 +30,5 @@ def bloomables(self) -> Tuple[bytes, ...]:
3030
return (
3131
self.address,
3232
) + tuple(
33-
int32.serialize(topic) for topic in self.topics
33+
uint32.serialize(topic) for topic in self.topics
3434
)

eth/rlp/receipts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from eth_bloom import BloomFilter
1111

1212
from .sedes import (
13-
int256,
13+
uint256,
1414
)
1515

1616
from .logs import Log
@@ -23,7 +23,7 @@ class Receipt(rlp.Serializable):
2323
fields = [
2424
('state_root', binary),
2525
('gas_used', big_endian_int),
26-
('bloom', int256),
26+
('bloom', uint256),
2727
('logs', CountableList(Log))
2828
]
2929

eth/rlp/sedes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
address = Binary.fixed_length(20, allow_empty=True)
1212
collation_body = Binary.fixed_length(COLLATION_SIZE)
1313
hash32 = Binary.fixed_length(32)
14-
int16 = BigEndianInt(16)
15-
int24 = BigEndianInt(24)
16-
int32 = BigEndianInt(32)
17-
int64 = BigEndianInt(64)
18-
int128 = BigEndianInt(128)
19-
int256 = BigEndianInt(256)
14+
uint16 = BigEndianInt(16)
15+
uint24 = BigEndianInt(24)
16+
uint32 = BigEndianInt(32)
17+
uint64 = BigEndianInt(64)
18+
uint128 = BigEndianInt(128)
19+
uint256 = BigEndianInt(256)
2020
trie_root = Binary.fixed_length(32, allow_empty=True)

0 commit comments

Comments
 (0)