Skip to content

Commit

Permalink
auctioneer+order: rename CurrentBatchVersion->LatestBatchVersion
Browse files Browse the repository at this point in the history
To make sure the CurrentBatchVersion isn't used anywhere as the default
version anymore by accident, we explicitly rename it.
  • Loading branch information
guggero committed Dec 22, 2021
1 parent e52b1ff commit cd3b6b6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions auctioneer/account_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestAccountSubscriptionAuthenticate(t *testing.T) {
sendMsg: sendMsg,
signer: testSigner,
msgChan: srvMsgChan,
batchVersion: order.CurrentBatchVersion,
batchVersion: order.LatestBatchVersion,
}
)

Expand Down Expand Up @@ -108,7 +108,7 @@ func TestAccountSubscriptionAuthenticateAbort(t *testing.T) {
sendMsg: sendMsg,
signer: testSigner,
msgChan: srvMsgChan,
batchVersion: order.CurrentBatchVersion,
batchVersion: order.LatestBatchVersion,
}
)

Expand Down Expand Up @@ -161,7 +161,7 @@ func TestAccountSubscriptionAuthenticateContextClose(t *testing.T) {
sendMsg: sendMsg,
signer: testSigner,
msgChan: srvMsgChan,
batchVersion: order.CurrentBatchVersion,
batchVersion: order.LatestBatchVersion,
}
ctxc, cancel = context.WithCancel(context.Background())
)
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestAccountSubscriptionAuthenticateError(t *testing.T) {
sendMsg: sendMsg,
signer: testSigner,
msgChan: srvMsgChan,
batchVersion: order.CurrentBatchVersion,
batchVersion: order.LatestBatchVersion,
errChan: make(chan error),
}
)
Expand Down
6 changes: 2 additions & 4 deletions order/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ const (
)

const (

// CurrentBatchVersion points to the version used by the client for
// verifying a batch.
CurrentBatchVersion = ExtendAccountBatchVersion
// LatestBatchVersion points to the most recent batch version.
LatestBatchVersion = ExtendAccountBatchVersion

// LegacyLeaseDurationBucket is the single static duration bucket that
// was used for orders before dynamic duration buckets were added.
Expand Down
6 changes: 3 additions & 3 deletions order/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestValidateOrderAccountIsolation(t *testing.T) {
orderStore := newMockStore()
orderManager := NewManager(&ManagerConfig{
Store: orderStore,
BatchVersion: CurrentBatchVersion,
BatchVersion: LatestBatchVersion,
})

// We'll now create two accounts, one that's 1 BTC in size, while the
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestValidateOrder(t *testing.T) {
orderStore := newMockStore()
orderManager := NewManager(&ManagerConfig{
Store: orderStore,
BatchVersion: CurrentBatchVersion,
BatchVersion: LatestBatchVersion,
})

// We'll now create an account with sufficient size.
Expand Down Expand Up @@ -272,7 +272,7 @@ func TestPrepareOrderSidecarTicket(t *testing.T) {
Wallet: test.NewMockWalletKit(),
Lightning: mockLightning,
Signer: mockSigner,
BatchVersion: CurrentBatchVersion,
BatchVersion: LatestBatchVersion,
})
require.NoError(t, mgr.Start())
defer mgr.Stop()
Expand Down

0 comments on commit cd3b6b6

Please sign in to comment.