Skip to content

Commit 26be0c7

Browse files
committed
itest: set universe.disable-supply-verifier-chain-watch flag
Update the universe server integration test harness to set the `universe.disable-supply-verifier-chain-watch` config flag. This ensures that tests exercise the correct runtime behavior of universe servers, which should verify only peer-submitted supply commitments rather than monitoring on-chain spends.
1 parent 5d91834 commit 26be0c7

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

itest/tapd_harness.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ type harnessOpts struct {
138138
// sendPriceHint indicates whether the tapd should send price hints from
139139
// the local oracle to the counterparty when requesting a quote.
140140
sendPriceHint bool
141+
142+
// disableSupplyVerifierChainWatch when true prevents the supply
143+
// verifier from starting state machines to watch on-chain outputs for
144+
// spends. This option is intended for universe servers, where supply
145+
// verification should only occur for commitments submitted by peers,
146+
// not via on-chain spend detection.
147+
disableSupplyVerifierChainWatch bool
141148
}
142149

143150
type harnessOption func(*harnessOpts)
@@ -154,6 +161,16 @@ func withOracleAddress(addr string) harnessOption {
154161
}
155162
}
156163

164+
// withDisableSupplyVerifierChainWatch is a functional option that disables
165+
// the supply verifier chain watch functionality. This is intended for universe
166+
// servers where supply verification should only occur for commitments submitted
167+
// by peers, not via on-chain spend detection.
168+
func withDisableSupplyVerifierChainWatch() harnessOption {
169+
return func(ho *harnessOpts) {
170+
ho.disableSupplyVerifierChainWatch = true
171+
}
172+
}
173+
157174
// newTapdHarness creates a new tapd server harness with the given
158175
// configuration.
159176
func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
@@ -234,6 +251,11 @@ func newTapdHarness(t *testing.T, ht *harnessTest, cfg tapdConfig,
234251
// was not set, this will be false, which is the default.
235252
tapCfg.AddrBook.DisableSyncer = opts.addrAssetSyncerDisable
236253

254+
// Pass through the supply verifier chain watch disable flag. If the option
255+
// was not set, this will be false, which is the default.
256+
// nolint: lll
257+
tapCfg.Universe.DisableSupplyVerifierChainWatch = opts.disableSupplyVerifierChainWatch
258+
237259
switch {
238260
case len(opts.oracleServerAddress) > 0:
239261
tapCfg.Experimental.Rfq.PriceOracleAddress =

itest/universe_server_harness.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ type universeServerHarness struct {
2323
func newUniverseServerHarness(t *testing.T, ht *harnessTest,
2424
lndHarness *node.HarnessNode) *universeServerHarness {
2525

26-
service, err := newTapdHarness(t, ht, tapdConfig{
27-
NetParams: harnessNetParams,
28-
LndNode: lndHarness,
29-
})
26+
service, err := newTapdHarness(
27+
t, ht, tapdConfig{
28+
NetParams: harnessNetParams,
29+
LndNode: lndHarness,
30+
}, withDisableSupplyVerifierChainWatch(),
31+
)
3032
require.NoError(t, err)
3133

3234
return &universeServerHarness{

0 commit comments

Comments
 (0)