-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement missing wallet methods and add transaction tests
- Loading branch information
1 parent
8af57ab
commit 26ec3b7
Showing
6 changed files
with
486 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ergo | ||
|
||
/* | ||
#include "ergo.h" | ||
*/ | ||
import "C" | ||
import "unsafe" | ||
|
||
// VerifySignature verifies that the signature is presented to satisfy SigmaProp conditions | ||
func VerifySignature(address Address, message []byte, signature SignedMessage) (bool, error) { | ||
byteData := C.CBytes(message) | ||
defer C.free(unsafe.Pointer(byteData)) | ||
|
||
res := C.ergo_lib_verify_signature(address.pointer(), (*C.uchar)(byteData), C.ulong(len(message)), signature.pointer()) | ||
err := newError(res.error) | ||
if err.isError() { | ||
return false, err.error() | ||
} | ||
return bool(res.value), nil | ||
} |
Oops, something went wrong.