mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-13 12:33:04 +02:00
rpcserver+order: make batch version configurable
This commit is contained in:
parent
1f50c7839a
commit
e52b1ff5a6
3 changed files with 17 additions and 7 deletions
|
|
@ -79,6 +79,10 @@ type ManagerConfig struct {
|
|||
|
||||
// Signer is used to sign orders before submitting them to the server.
|
||||
Signer lndclient.SignerClient
|
||||
|
||||
// BatchVersion is the batch version that we should use to verify new
|
||||
// batches against.
|
||||
BatchVersion BatchVersion
|
||||
}
|
||||
|
||||
// manager is responsible for the management of orders.
|
||||
|
|
@ -138,7 +142,7 @@ func (m *manager) Start() error {
|
|||
getAccount: m.cfg.AcctStore.Account,
|
||||
wallet: m.cfg.Wallet,
|
||||
ourNodePubkey: m.ourNodeInfo.IdentityPubkey,
|
||||
version: CurrentBatchVersion,
|
||||
version: m.cfg.BatchVersion,
|
||||
}
|
||||
m.batchSigner = &batchSigner{
|
||||
getAccount: m.cfg.AcctStore.Account,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ func TestValidateOrderAccountIsolation(t *testing.T) {
|
|||
|
||||
orderStore := newMockStore()
|
||||
orderManager := NewManager(&ManagerConfig{
|
||||
Store: orderStore,
|
||||
Store: orderStore,
|
||||
BatchVersion: CurrentBatchVersion,
|
||||
})
|
||||
|
||||
// We'll now create two accounts, one that's 1 BTC in size, while the
|
||||
|
|
@ -109,7 +110,8 @@ func TestValidateOrder(t *testing.T) {
|
|||
|
||||
orderStore := newMockStore()
|
||||
orderManager := NewManager(&ManagerConfig{
|
||||
Store: orderStore,
|
||||
Store: orderStore,
|
||||
BatchVersion: CurrentBatchVersion,
|
||||
})
|
||||
|
||||
// We'll now create an account with sufficient size.
|
||||
|
|
@ -266,10 +268,11 @@ func TestPrepareOrderSidecarTicket(t *testing.T) {
|
|||
mockLightning := test.NewMockLightning()
|
||||
mockSigner := test.NewMockSigner()
|
||||
mgr := NewManager(&ManagerConfig{
|
||||
AcctStore: &mockAccountStore{},
|
||||
Wallet: test.NewMockWalletKit(),
|
||||
Lightning: mockLightning,
|
||||
Signer: mockSigner,
|
||||
AcctStore: &mockAccountStore{},
|
||||
Wallet: test.NewMockWalletKit(),
|
||||
Lightning: mockLightning,
|
||||
Signer: mockSigner,
|
||||
BatchVersion: CurrentBatchVersion,
|
||||
})
|
||||
require.NoError(t, mgr.Start())
|
||||
defer mgr.Stop()
|
||||
|
|
|
|||
|
|
@ -117,6 +117,9 @@ func newRPCServer(server *Server) *rpcServer {
|
|||
Lightning: lndServices.Client,
|
||||
Wallet: lndServices.WalletKit,
|
||||
Signer: lndServices.Signer,
|
||||
BatchVersion: order.BatchVersion(
|
||||
server.cfg.DebugConfig.BatchVersion,
|
||||
),
|
||||
}),
|
||||
marshaler: NewMarshaler(&marshalerConfig{
|
||||
GetOrders: server.db.GetOrders,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue