Skip to content

Commit

Permalink
Use error code ERROR_INCORRECT_SINCE_FLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
XuJiandong committed Feb 27, 2024
1 parent d367ee2 commit 38585b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion c/omni_lock_time_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define OMNI_LOCK_TIME_LOCK_H_

#include "ckb_utils.h"
#define ERROR_INCORRECT_SINCE_FLAGS (-23)
#define ERROR_INCORRECT_SINCE_VALUE (-24)

/* check since,
Expand All @@ -27,7 +28,7 @@ int check_since(uint64_t since) {
int comparable = 1;
int cmp = ckb_since_cmp(since, input_since, &comparable);
if (!comparable) {
return ERROR_INCORRECT_SINCE_VALUE;
return ERROR_INCORRECT_SINCE_FLAGS;
}
if (cmp == 1) {
return ERROR_INCORRECT_SINCE_VALUE;
Expand Down
6 changes: 3 additions & 3 deletions tests/omni_lock_rust/tests/test_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ fn test_multisig_0_2_3_unlock_with_since_relative_not_comparable() {
let mut verifier = verify_tx(resolved_tx, data_loader);
verifier.set_debug_printer(debug_printer);
let verify_result = verifier.verify(MAX_CYCLES);
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_VALUE)
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_FLAGS)
}

#[test]
Expand All @@ -390,7 +390,7 @@ fn test_multisig_0_2_3_unlock_with_since_flags() {
let mut verifier = verify_tx(resolved_tx, data_loader);
verifier.set_debug_printer(debug_printer);
let verify_result = verifier.verify(MAX_CYCLES);
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_VALUE)
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_FLAGS)
}

#[test]
Expand Down Expand Up @@ -434,7 +434,7 @@ fn test_multisig_0_2_3_unlock_with_since_epoch() {
let mut verifier = verify_tx(resolved_tx, data_loader);
verifier.set_debug_printer(debug_printer);
let verify_result = verifier.verify(MAX_CYCLES);
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_VALUE)
assert_script_error(verify_result.unwrap_err(), ERROR_INCORRECT_SINCE_FLAGS)
}

#[test]
Expand Down

0 comments on commit 38585b6

Please sign in to comment.