Made ecrecover implementation trait public (#11188)
* Made ecrecover Implementation trait public * Make all builtin contract types public This ensure the API is consistent in terms of visibility.
This commit is contained in:
parent
20bd1fa789
commit
81ca599f2a
@ -37,7 +37,7 @@ use parity_crypto::digest;
|
|||||||
use eip_152::compress;
|
use eip_152::compress;
|
||||||
|
|
||||||
/// Native implementation of a built-in contract.
|
/// Native implementation of a built-in contract.
|
||||||
trait Implementation: Send + Sync {
|
pub trait Implementation: Send + Sync {
|
||||||
/// execute this built-in on the given input, writing to the given output.
|
/// execute this built-in on the given input, writing to the given output.
|
||||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), &'static str>;
|
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), &'static str>;
|
||||||
}
|
}
|
||||||
@ -305,31 +305,31 @@ fn ethereum_builtin(name: &str) -> Result<Box<dyn Implementation>, EthcoreError>
|
|||||||
// - blake2_f (The Blake2 compression function F, EIP-152)
|
// - blake2_f (The Blake2 compression function F, EIP-152)
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Identity;
|
pub struct Identity;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct EcRecover;
|
pub struct EcRecover;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Sha256;
|
pub struct Sha256;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Ripemd160;
|
pub struct Ripemd160;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Modexp;
|
pub struct Modexp;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Bn128Add;
|
pub struct Bn128Add;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Bn128Mul;
|
pub struct Bn128Mul;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Bn128Pairing;
|
pub struct Bn128Pairing;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Blake2F;
|
pub struct Blake2F;
|
||||||
|
|
||||||
impl Implementation for Identity {
|
impl Implementation for Identity {
|
||||||
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), &'static str> {
|
fn execute(&self, input: &[u8], output: &mut BytesRef) -> Result<(), &'static str> {
|
||||||
|
Loading…
Reference in New Issue
Block a user