ethcore: add missing builtins benchmarks (#9170)

* ethcore: add modexp benchmarks

* ethcore: add_bn_128_add benchmark
This commit is contained in:
André Silva
2018-07-20 14:06:11 +01:00
committed by Marek Kotewicz
parent b914912c06
commit fb2b77e991
3 changed files with 147 additions and 7 deletions

View File

@@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
//! Standard built-in contracts.
use std::cmp::{max, min};
use std::io::{self, Read};
@@ -27,6 +29,7 @@ use bytes::BytesRef;
use ethkey::{Signature, recover as ec_recover};
use ethjson;
/// Execution error.
#[derive(Debug)]
pub struct Error(pub &'static str);
@@ -207,8 +210,8 @@ impl From<ethjson::spec::Builtin> for Builtin {
}
}
// Ethereum builtin creator.
fn ethereum_builtin(name: &str) -> Box<Impl> {
/// Ethereum built-in factory.
pub fn ethereum_builtin(name: &str) -> Box<Impl> {
match name {
"identity" => Box::new(Identity) as Box<Impl>,
"ecrecover" => Box::new(EcRecover) as Box<Impl>,

View File

@@ -146,6 +146,7 @@ pub mod views;
pub mod account_provider;
pub mod block;
pub mod builtin;
pub mod client;
pub mod db;
pub mod encoded;
@@ -168,7 +169,6 @@ pub mod verification;
mod cache_manager;
mod pod_account;
mod account_db;
mod builtin;
mod externalities;
mod blockchain;
mod factory;