Skip to content

Commit ea7a812

Browse files
updated basic features tests
1 parent bff6ccf commit ea7a812

File tree

10 files changed

+15
-8
lines changed

10 files changed

+15
-8
lines changed

chain/vm/src/host/vm_hooks/vh_handler/vh_crypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<C: VMHooksContext> VMHooksHandler<C> {
6161
crypto_functions::verify_ed25519(key, message, signature)
6262
};
6363
if !sig_valid {
64-
return Err(early_exit_vm_error(vm_err_msg::CRYPTO_INVALID_SIGNATURE));
64+
return Err(early_exit_vm_error(vm_err_msg::CRYPTO_ED25519_ERROR));
6565
}
6666

6767
Ok(())

chain/vm/src/vm_err_msg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ pub const ERROR_BYTES_EXCEED_UINT64: &str = "bytes cannot be parsed as uint64";
2727
pub const PROMISES_TOKENIZE_FAILED: &str = "tokenize failed";
2828

2929
pub const CRYPTO_INVALID_SIGNATURE: &str = "invalid signature";
30+
pub const CRYPTO_ED25519_ERROR: &str = "ed25519 verify error";

contracts/feature-tests/basic-features/scenarios/crypto_verify_bls.scen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"expect": {
5959
"out": [],
6060
"status": "10",
61-
"message": "str:signature is invalid",
61+
"message": "str:bls verify error",
6262
"logs": "*",
6363
"gas": "*",
6464
"refund": "*"

contracts/feature-tests/basic-features/scenarios/crypto_verify_bls_aggregated_signature.scen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"expect": {
7171
"out": [],
7272
"status": "10",
73-
"message": "str:signature is invalid",
73+
"message": "str:bls verify error",
7474
"logs": "*",
7575
"gas": "*",
7676
"refund": "*"

contracts/feature-tests/basic-features/scenarios/crypto_verify_bls_share.scen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"expect": {
5959
"out": [],
6060
"status": "10",
61-
"message": "str:signature is invalid",
61+
"message": "str:bls verify error",
6262
"logs": "*",
6363
"gas": "*",
6464
"refund": "*"

contracts/feature-tests/basic-features/scenarios/crypto_verify_ed25519.scen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"expect": {
5656
"out": [],
5757
"status": "10",
58-
"message": "str:invalid signature",
58+
"message": "str:ed25519 verify error",
5959
"logs": "*",
6060
"gas": "*",
6161
"refund": "*"

contracts/feature-tests/basic-features/scenarios/crypto_verify_secp256r1.scen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"expect": {
5858
"out": [],
5959
"status": "10",
60-
"message": "str:signature is invalid",
60+
"message": "str:secp256k1 verify error",
6161
"logs": "*",
6262
"gas": "*",
6363
"refund": "*"

contracts/feature-tests/basic-features/tests/basic_features_scenario_go_test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,25 @@ fn crypto_sha_256_go() {
8080
}
8181

8282
#[test]
83+
#[ignore = "TODO: error message changed, unignore after Barnard"]
8384
fn crypto_verify_bls_go() {
8485
world().run("scenarios/crypto_verify_bls.scen.json");
8586
}
8687

8788
#[test]
89+
#[ignore = "TODO: error message changed, unignore after Barnard"]
8890
fn crypto_verify_bls_aggregated_signature_go() {
8991
world().run("scenarios/crypto_verify_bls_aggregated_signature.scen.json");
9092
}
9193

9294
#[test]
95+
#[ignore = "TODO: error message changed, unignore after Barnard"]
9396
fn crypto_verify_bls_share_go() {
9497
world().run("scenarios/crypto_verify_bls_share.scen.json");
9598
}
9699

97100
#[test]
101+
#[ignore = "TODO: error message changed, unignore after Barnard"]
98102
fn crypto_verify_ed_25519_go() {
99103
world().run("scenarios/crypto_verify_ed25519.scen.json");
100104
}
@@ -105,6 +109,7 @@ fn crypto_verify_secp_256_k_1_go() {
105109
}
106110

107111
#[test]
112+
#[ignore = "TODO: error message changed, unignore after Barnard"]
108113
fn crypto_verify_secp_256_r_1_go() {
109114
world().run("scenarios/crypto_verify_secp256r1.scen.json");
110115
}

contracts/feature-tests/big-float-features/scenarios/big_float_operator_checks.scen.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"expect": {
3333
"out": [],
3434
"status": "10",
35-
"message": "str:this big Float operation is not permitted while doing float.Add"
35+
"message": "str:big float decode error"
3636
}
3737
},
3838
{
@@ -72,7 +72,7 @@
7272
"expect": {
7373
"out": [],
7474
"status": "10",
75-
"message": "str:this big Float operation is not permitted while doing float.Sub"
75+
"message": "str:big float decode error"
7676
}
7777
}
7878
]

contracts/feature-tests/big-float-features/tests/big_float_scenario_go_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ fn big_float_new_from_sci_go() {
4545
}
4646

4747
#[test]
48+
#[ignore = "TODO: error message changed, unignore after Barnard"]
4849
fn big_float_operator_checks_go() {
4950
world().run("scenarios/big_float_operator_checks.scen.json");
5051
}

0 commit comments

Comments
 (0)