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,7 +44,14 @@ impl Encodable for TxValue {
|
|||||||
impl Decodable for TxValue {
|
impl Decodable for TxValue {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn decode(buf: &mut &[u8]) -> Result<Self, Error> {
|
fn decode(buf: &mut &[u8]) -> Result<Self, Error> {
|
||||||
U256::decode(buf).map(Self)
|
#[cfg(feature = "optimism")]
|
||||||
|
{
|
||||||
|
U256::decode(buf).map(Self)
|
||||||
|
}
|
||||||
|
#[cfg(not(feature = "optimism"))]
|
||||||
|
{
|
||||||
|
u128::decode(buf).map(Self::from)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user