Skip to content

Commit

Permalink
undo err update
Browse files Browse the repository at this point in the history
  • Loading branch information
setzeus committed Apr 2, 2024
1 parent cc740cb commit 7dfe1bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions stackslib/src/chainstate/stacks/boot/pox-4.clar
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
(define-constant ERR_SIGNER_AUTH_AMOUNT_TOO_HIGH 38)
(define-constant ERR_SIGNER_AUTH_USED 39)
(define-constant ERR_INVALID_INCREASE 40)
(define-constant ERR_INVALID_SIGNER_AUTH 41)

;; Valid values for burnchain address versions.
;; These first four correspond to address hash modes in Stacks 2.1,
Expand Down Expand Up @@ -754,7 +753,7 @@
;; `signer-sig` is not present, verify that an authorization was previously added for this key
(ok (asserts! (default-to false (map-get? signer-key-authorizations
{ signer-key: signer-key, reward-cycle: reward-cycle, period: period, topic: topic, pox-addr: pox-addr, auth-id: auth-id, max-amount: max-amount }))
(err ERR_INVALID_SIGNER_AUTH)))
(err ERR_NOT_ALLOWED)))
))
)

Expand Down
14 changes: 7 additions & 7 deletions stackslib/src/chainstate/stacks/boot/pox_4_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3934,7 +3934,7 @@ fn stack_stx_signer_auth() {
let stacker_txs =
get_last_block_sender_transactions(&observer, key_to_stacks_addr(&stacker_key));

let expected_error = Value::error(Value::Int(41)).unwrap();
let expected_error = Value::error(Value::Int(19)).unwrap();

assert_eq!(stacker_txs.len(), (stacker_nonce + 1) as usize);
let stacker_tx_result =
Expand Down Expand Up @@ -4072,7 +4072,7 @@ fn stack_agg_commit_signer_auth() {
let tx_result =
|nonce: u64| -> Value { delegate_txs.get(nonce as usize).unwrap().result.clone() };

let expected_error = Value::error(Value::Int(41)).unwrap();
let expected_error = Value::error(Value::Int(19)).unwrap();
assert_eq!(tx_result(invalid_agg_nonce), expected_error);
let successful_agg_result = tx_result(valid_agg_nonce);
successful_agg_result
Expand Down Expand Up @@ -4178,7 +4178,7 @@ fn stack_extend_signer_auth() {
let tx_result =
|nonce: u64| -> Value { stacker_txs.get(nonce as usize).unwrap().result.clone() };

let expected_error = Value::error(Value::Int(41)).unwrap();
let expected_error = Value::error(Value::Int(19)).unwrap();
assert_eq!(tx_result(invalid_extend_nonce), expected_error);

let valid_extend_tx_result = tx_result(valid_extend_nonce);
Expand Down Expand Up @@ -5521,7 +5521,7 @@ fn test_scenario_one() {
.unwrap();
assert_eq!(alice_replay_result, Value::Int(35));

// Check Bob replay, expect (err 41) - ERR_SIGNER_AUTH_USED
// Check Bob replay, expect (err 19) - ERR_SIGNER_AUTH_USED
let bob_tx_result = tx_block
.receipts
.get(2)
Expand All @@ -5530,7 +5530,7 @@ fn test_scenario_one() {
.clone()
.expect_result_err()
.unwrap();
assert_eq!(bob_tx_result, Value::Int(41));
assert_eq!(bob_tx_result, Value::Int(19));
}

// In this test two solo service signers, Alice & Bob, provide auth
Expand Down Expand Up @@ -5771,7 +5771,7 @@ fn test_scenario_two() {
.clone();
assert_eq!(signer_key_expected, signer_key_actual);

// Check Dave's malformed pox stack transaction (err 41 - INVALID_SIGNER_AUTH)
// Check Dave's malformed pox stack transaction (err 19 - INVALID_SIGNER_AUTH)
let dave_tx_result_err = tx_block
.receipts
.get(4)
Expand All @@ -5780,7 +5780,7 @@ fn test_scenario_two() {
.clone()
.expect_result_err()
.unwrap();
assert_eq!(dave_tx_result_err, Value::Int(41));
assert_eq!(dave_tx_result_err, Value::Int(19));

// Check Dave's expected stack transaction
let dave_tx_result_ok = tx_block
Expand Down

0 comments on commit 7dfe1bb

Please sign in to comment.