(eth: f64)
| 141 | |
| 142 | pub const WEI_PER_ETH: u64 = 1_000_000_000_000_000_000; |
| 143 | pub fn eth_to_wei(eth: f64) -> U256 { |
| 144 | U256::from((eth * WEI_PER_ETH as f64).floor()) |
| 145 | } |
| 146 | |
| 147 | // Serde |
| 148 | /// Test that the encoding and decoding works, returns the decoded struct |