Skip to content

Commit 1eafb65

Browse files
committed
Fix secp256k1_verify import names
1 parent eee764e commit 1eafb65

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/std/src/imports.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern "C" {
3737
fn canonicalize_address(source_ptr: u32, destination_ptr: u32) -> u32;
3838
fn humanize_address(source_ptr: u32, destination_ptr: u32) -> u32;
3939

40-
fn verify_secp256k1(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32;
40+
fn secp256k1_verify(message_hash_ptr: u32, signature_ptr: u32, public_key_ptr: u32) -> u32;
4141

4242
fn debug(source_ptr: u32);
4343

@@ -195,11 +195,11 @@ impl Api for ExternalApi {
195195
let pubkey_send = build_region(public_key);
196196
let pubkey_send_ptr = &*pubkey_send as *const Region as u32;
197197

198-
let result = unsafe { verify_secp256k1(hash_send_ptr, sig_send_ptr, pubkey_send_ptr) };
198+
let result = unsafe { secp256k1_verify(hash_send_ptr, sig_send_ptr, pubkey_send_ptr) };
199199
match result {
200200
1 => Ok(true),
201201
0 => Ok(false),
202-
x => panic!(format!("unexpected verify_secp256k1 return value: {}", x)),
202+
x => panic!(format!("unexpected secp256k1_verify return value: {}", x)),
203203
}
204204
}
205205

packages/vm/src/imports.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ pub fn native_humanize_address<A: Api, S: Storage, Q: Querier>(
8989
do_humanize_address(&env, source_ptr, destination_ptr)
9090
}
9191

92-
pub fn native_verify_secp256k1<A: Api, S: Storage, Q: Querier>(
92+
pub fn native_secp256k1_verify<A: Api, S: Storage, Q: Querier>(
9393
env: &Environment<A, S, Q>,
9494
hash_ptr: u32,
9595
signature_ptr: u32,
9696
pubkey_ptr: u32,
9797
) -> VmResult<u32> {
98-
do_verify_secp256k1(env, hash_ptr, signature_ptr, pubkey_ptr)
98+
do_secp256k1_verify(env, hash_ptr, signature_ptr, pubkey_ptr)
9999
}
100100

101101
pub fn native_query_chain<A: Api, S: Storage, Q: Querier>(
@@ -258,7 +258,7 @@ fn do_humanize_address<A: Api, S: Storage, Q: Querier>(
258258
}
259259
}
260260

261-
fn do_verify_secp256k1<A: Api, S: Storage, Q: Querier>(
261+
fn do_secp256k1_verify<A: Api, S: Storage, Q: Querier>(
262262
env: &Environment<A, S, Q>,
263263
hash_ptr: u32,
264264
signature_ptr: u32,

packages/vm/src/instance.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::errors::{CommunicationError, VmError, VmResult};
1010
use crate::features::required_features_from_wasmer_instance;
1111
use crate::imports::{
1212
native_canonicalize_address, native_db_read, native_db_remove, native_db_write, native_debug,
13-
native_humanize_address, native_query_chain, native_verify_secp256k1,
13+
native_humanize_address, native_query_chain, native_secp256k1_verify,
1414
};
1515
#[cfg(feature = "iterator")]
1616
use crate::imports::{native_db_next, native_db_scan};
@@ -126,8 +126,8 @@ where
126126
// Returns 0 on success. Returns a non-zero memory location to a Region containing an UTF-8 encoded error string for invalid inputs.
127127
// Ownership of input pointers is not transferred to the host.
128128
env_imports.insert(
129-
"verify_secp256k1",
130-
Function::new_native_with_env(store, env.clone(), native_verify_secp256k1),
129+
"secp256k1_verify",
130+
Function::new_native_with_env(store, env.clone(), native_secp256k1_verify),
131131
);
132132

133133
// Allows the contract to emit debug logs that the host can either process or ignore.

0 commit comments

Comments
 (0)