fixed eth_call, eth_sendTransaction and eth_estimateGas
This commit is contained in:
@@ -20,6 +20,7 @@ use numbers::*;
|
||||
use bytes::*;
|
||||
use secp256k1::{key, Secp256k1};
|
||||
use rand::os::OsRng;
|
||||
use sha3::Hashable;
|
||||
|
||||
/// Secret key for secp256k1 EC operations. 256 bit generic "hash" data.
|
||||
pub type Secret = H256;
|
||||
@@ -135,15 +136,22 @@ impl KeyPair {
|
||||
public: p,
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns public key
|
||||
pub fn public(&self) -> &Public {
|
||||
&self.public
|
||||
}
|
||||
|
||||
/// Returns private key
|
||||
pub fn secret(&self) -> &Secret {
|
||||
&self.secret
|
||||
}
|
||||
|
||||
/// Returns address.
|
||||
pub fn address(&self) -> Address {
|
||||
Address::from(self.public.sha3())
|
||||
}
|
||||
|
||||
/// Sign a message with our secret key.
|
||||
pub fn sign(&self, message: &H256) -> Result<Signature, CryptoError> { ec::sign(&self.secret, message) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user