mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix: prevent decoding U256 TxValue on mainnet (#5344)
This commit is contained in:
@ -44,8 +44,15 @@ impl Encodable for TxValue {
|
||||
impl Decodable for TxValue {
|
||||
#[inline]
|
||||
fn decode(buf: &mut &[u8]) -> Result<Self, Error> {
|
||||
#[cfg(feature = "optimism")]
|
||||
{
|
||||
U256::decode(buf).map(Self)
|
||||
}
|
||||
#[cfg(not(feature = "optimism"))]
|
||||
{
|
||||
u128::decode(buf).map(Self::from)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// As ethereum circulation on mainnet is around 120mil eth as of 2022 that is around
|
||||
|
||||
Reference in New Issue
Block a user