Cleanup after merge of PR

This commit is contained in:
John Newby
2019-08-15 12:55:08 +02:00
parent 3c6b1fae4c
commit 9347bee344
2 changed files with 17 additions and 13 deletions
+5 -8
View File
@@ -7,8 +7,8 @@ extern crate parity_bytes;
#[macro_use]
extern crate rustler;
use ethcore_builtin::EcRecover;
use crate::ethcore_builtin::Implementation;
use ethcore_builtin::EcRecover;
use parity_bytes::BytesRef;
use rustler::*;
@@ -20,13 +20,10 @@ mod atoms {
rustler_export_nifs!(
"ecrecover",
[
("ecrecover", 1, nif_ecrecover),
],
[("recover_", 1, nif_ecrecover),],
Some(on_load)
);
#[no_mangle]
fn on_load(_env: Env, _load_info: Term) -> bool {
true
@@ -35,9 +32,9 @@ fn on_load(_env: Env, _load_info: Term) -> bool {
pub fn nif_ecrecover<'a>(env: Env<'a>, args: &[Term<'a>]) -> Result<Term<'a>, Error> {
let input: Binary = args[0].decode()?;
let mut byte_ref = Vec::new();
let ecrecover = EcRecover { };
let _result = match ecrecover.execute(input.as_slice(),
&mut BytesRef::Fixed(&mut byte_ref)) {
let ecrecover = EcRecover {};
let _result = match ecrecover.execute(input.as_slice(), &mut BytesRef::Flexible(&mut byte_ref))
{
Ok(_) => (),
Err(_e) => return Err(rustler::Error::Atom("ecrecover_failed")),
};