Merge pull request #787 from ethcore/eth_estimateGas

eth_estimateGas
This commit is contained in:
Marek Kotewicz
2016-03-20 15:13:22 +01:00
10 changed files with 193 additions and 14 deletions

View File

@@ -490,6 +490,8 @@ pub trait Uint: Sized + Default + FromStr + From<u64> + fmt::Debug + fmt::Displa
fn zero() -> Self;
/// Returns new instance equalling one.
fn one() -> Self;
/// Returns the largest value that can be represented by this integer type.
fn max_value() -> Self;
/// Error type for converting from a decimal string.
type FromDecStrErr;
@@ -647,6 +649,15 @@ macro_rules! construct_uint {
From::from(1u64)
}
#[inline]
fn max_value() -> Self {
let mut result = [0; $n_words];
for i in 0..$n_words {
result[i] = u64::max_value();
}
$name(result)
}
/// Fast exponentation by squaring
/// https://en.wikipedia.org/wiki/Exponentiation_by_squaring
fn pow(self, expon: Self) -> Self {