Skip to content

Commit

Permalink
Revert "[test] Add a signature test for verify message signature from…
Browse files Browse the repository at this point in the history
… starcoin cli. (#17)"

This reverts commit f88c277.
  • Loading branch information
nkysg committed Mar 2, 2023
1 parent df6b29f commit 4f34c17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
12 changes: 2 additions & 10 deletions spectests/natives/signature.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
processed 5 tasks
processed 4 tasks

task 2 'run'. lines 5-25:
{
Expand All @@ -8,15 +8,7 @@ task 2 'run'. lines 5-25:
}
}

task 3 'run'. lines 28-50:
{
"gas_used": 33522,
"status": {
"Keep": "Executed"
}
}

task 4 'run'. lines 52-87:
task 3 'run'. lines 27-62:
{
"gas_used": 170726,
"status": {
Expand Down
25 changes: 0 additions & 25 deletions spectests/natives/signature.move
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,6 @@ fun main() {
}
}


//# run --signers creator
// Test fot signature verify
// use command `starcoin account sign-message --message abc` to generate signature.
script {
use StarcoinFramework::Signature;
use StarcoinFramework::Hash;
use StarcoinFramework::Vector;
use StarcoinFramework::BCS;

fun main() {

let public_key = x"a7c56b0c7111a7068cbd5f8c841a3d01eed480cfc14806e43e7a1da71e2945f0";
let message = b"abc";
let signature = x"c46ad802f389f7e17631b28668e51565fa59b80c34b44719791c4f541b586239896fd470d64c6eff1bdfadab9861e193042dbafd8f23fda670530cce4f199f0d";
let prefix = b"STARCOIN::";
Vector::append(&mut prefix, b"SigningMessage");
let prefix_hash = Hash::sha3_256(prefix);
let data = copy prefix_hash;
Vector::append(&mut data, BCS::to_bytes(&message));
assert!(Signature::ed25519_verify(signature, public_key, data), 9004);
}

}

//# run --signers creator

// test ecrecover
Expand Down

0 comments on commit 4f34c17

Please sign in to comment.