Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
adria0 committed Feb 5, 2024
1 parent 7ea56e9 commit df7f37a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions geth-utils/lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type GetWitnessRequest struct {
Mods []witness.TrieModification
}

//export GetWitness
func GetWitness(proofConf *C.char) *C.char {
//export GetMptWitness
func GetMptWitness(proofConf *C.char) *C.char {
var config GetWitnessRequest

err := json.Unmarshal([]byte(C.GoString(proofConf)), &config)
Expand Down
2 changes: 1 addition & 1 deletion geth-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod go {
use std::os::raw::c_char;
extern "C" {
pub fn CreateTrace(str: *const c_char) -> *const c_char;
pub fn GetWitness(str: *const c_char) -> *const c_char;
pub fn GetMptWitness(str: *const c_char) -> *const c_char;
pub fn FreeString(str: *const c_char);
}
}
2 changes: 1 addition & 1 deletion geth-utils/src/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn get_witness(block_no: u64, mods: &[TrieModification], node_url: &str) ->

let json = serde_json::to_string(&req).expect("Invalid request");
let c_config = CString::new(json).expect("invalid config");
let result = unsafe { go::GetWitness(c_config.as_ptr() as *const i8) };
let result = unsafe { go::GetMptWitness(c_config.as_ptr() as *const i8) };
let c_str = unsafe { CStr::from_ptr(result) };
let json = c_str
.to_str()
Expand Down

0 comments on commit df7f37a

Please sign in to comment.