Skip to content

Commit 7cf94df

Browse files
authored
fix(rm spending counter tests): audit tooling f11 (#665)
NOT PRODUCTION CODE The following is our[ production chain-libs](https://github.com/input-output-hk/chain-libs/tree/catalyst-fund9-gold) We have removed spending counter logic long ago due to inherent flaws in the context of correctness. Audit tooling on cat core needs to reflect this to perform a correct offline tally without errors hence removing the checks.
1 parent 8eeba8c commit 7cf94df

File tree

1 file changed

+5
-25
lines changed
  • src/chain-libs/chain-impl-mockchain/src/accounting/account

1 file changed

+5
-25
lines changed

src/chain-libs/chain-impl-mockchain/src/accounting/account/spending.rs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,14 @@ impl SpendingCounterIncreasing {
5858
/// an error reported.
5959
///
6060
/// If the counter match succesfully, then the counter at this lane is incremented by one.
61-
pub fn next_verify(&mut self, counter: SpendingCounter) -> Result<(), Error> {
62-
let actual_counter = self.nexts[counter.lane()];
63-
64-
if actual_counter != counter {
65-
Err(Error::SpendingCredentialInvalid {
66-
expected: actual_counter,
67-
actual: counter,
68-
})
69-
} else {
70-
self.next_unchecked(counter);
71-
Ok(())
72-
}
61+
pub fn next_verify(&mut self, _counter: SpendingCounter) -> Result<(), Error> {
62+
// spending counter has been removed
63+
Ok(())
7364
}
7465

7566
/// Increases the spending counter on the given lane.
76-
pub(crate) fn next_unchecked(&mut self, unchecked_counter: SpendingCounter) {
77-
let lane = unchecked_counter.lane();
78-
let counter_to_update = self.nexts[lane];
79-
if counter_to_update != unchecked_counter {
80-
tracing::warn!(
81-
"Invalid spending counter, {}",
82-
Error::SpendingCredentialInvalid {
83-
expected: counter_to_update,
84-
actual: unchecked_counter,
85-
}
86-
);
87-
}
88-
self.nexts[lane] = counter_to_update.increment();
67+
pub(crate) fn next_unchecked(&mut self, _unchecked_counter: SpendingCounter) {
68+
// spending counter removed
8969
}
9070
}
9171

0 commit comments

Comments
 (0)