fix: prevent decoding U256 TxValue on mainnet (#5344)

This commit is contained in:
Dan Cline
2023-11-07 14:38:34 -05:00
committed by GitHub
parent 47669c5886
commit 1b2a4c71c7

View File

@ -44,7 +44,14 @@ impl Encodable for TxValue {
impl Decodable for TxValue {
#[inline]
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)
}
}
}