mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-10-05 19:28:26 +00:00
Fix counter mutations
This commit is contained in:
@@ -206,6 +206,13 @@ export const MintProofsCounterModel = types
|
|||||||
counter: self.counter,
|
counter: self.counter,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setProofsCounter(newCounter: number) {
|
||||||
|
self.counter = newCounter
|
||||||
|
log.debug('[setProofsCounter]', 'Set proofsCounter', {
|
||||||
|
counter: self.counter,
|
||||||
|
})
|
||||||
|
},
|
||||||
}))
|
}))
|
||||||
.views(self => ({
|
.views(self => ({
|
||||||
// === In-flight requests ===
|
// === In-flight requests ===
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ export const WalletStoreModel = types
|
|||||||
throw new AppError(Err.VALIDATION_ERROR, 'Missing mint instance', {mintUrl})
|
throw new AppError(Err.VALIDATION_ERROR, 'Missing mint instance', {mintUrl})
|
||||||
}
|
}
|
||||||
|
|
||||||
const cashuWallet = yield self.getWallet(
|
const cashuWallet: CashuWallet = yield self.getWallet(
|
||||||
mintUrl,
|
mintUrl,
|
||||||
unit,
|
unit,
|
||||||
{
|
{
|
||||||
@@ -474,7 +474,7 @@ export const WalletStoreModel = types
|
|||||||
|
|
||||||
// Update our counter to match what the wallet used (v3.x)
|
// Update our counter to match what the wallet used (v3.x)
|
||||||
if (reservedCounters) {
|
if (reservedCounters) {
|
||||||
currentCounter.counter = reservedCounters.next
|
currentCounter.setProofsCounter(reservedCounters.next)
|
||||||
log.debug('[receive] Updated counter', {
|
log.debug('[receive] Updated counter', {
|
||||||
keysetId: reservedCounters.keysetId,
|
keysetId: reservedCounters.keysetId,
|
||||||
start: reservedCounters.start,
|
start: reservedCounters.start,
|
||||||
@@ -589,7 +589,7 @@ export const WalletStoreModel = types
|
|||||||
|
|
||||||
// Update our counter to match what the wallet used (v3.x)
|
// Update our counter to match what the wallet used (v3.x)
|
||||||
if (reservedCounters) {
|
if (reservedCounters) {
|
||||||
currentCounter.counter = reservedCounters.next
|
currentCounter.setProofsCounter(reservedCounters.next)
|
||||||
log.debug('[send] Updated counter', {
|
log.debug('[send] Updated counter', {
|
||||||
keysetId: reservedCounters.keysetId,
|
keysetId: reservedCounters.keysetId,
|
||||||
start: reservedCounters.start,
|
start: reservedCounters.start,
|
||||||
@@ -818,7 +818,7 @@ export const WalletStoreModel = types
|
|||||||
|
|
||||||
// Update our counter to match what the wallet used (v3.x)
|
// Update our counter to match what the wallet used (v3.x)
|
||||||
if (reservedCounters) {
|
if (reservedCounters) {
|
||||||
currentCounter.counter = reservedCounters.next
|
currentCounter.setProofsCounter(reservedCounters.next)
|
||||||
log.debug('[mintProofs] Updated counter', {
|
log.debug('[mintProofs] Updated counter', {
|
||||||
keysetId: reservedCounters.keysetId,
|
keysetId: reservedCounters.keysetId,
|
||||||
start: reservedCounters.start,
|
start: reservedCounters.start,
|
||||||
@@ -942,7 +942,7 @@ export const WalletStoreModel = types
|
|||||||
|
|
||||||
// Update our counter to match what the wallet used (v3.x)
|
// Update our counter to match what the wallet used (v3.x)
|
||||||
if (reservedCounters) {
|
if (reservedCounters) {
|
||||||
currentCounter.counter = reservedCounters.next
|
currentCounter.setProofsCounter(reservedCounters.next)
|
||||||
log.debug('[prepareMelt] Updated counter', {
|
log.debug('[prepareMelt] Updated counter', {
|
||||||
keysetId: reservedCounters.keysetId,
|
keysetId: reservedCounters.keysetId,
|
||||||
start: reservedCounters.start,
|
start: reservedCounters.start,
|
||||||
|
|||||||
Reference in New Issue
Block a user