Skip to content

Commit 9f03b39

Browse files
committed
tapgarden: extend GardenKit with delegation and supply commit support
This commit enhances the GardenKit configuration by adding two new optional dependencies: DelegationKeyChecker and MintCommitter. These additions enable the garden subsystem to verify delegation key ownership and submit mint events to the supply commitment state machine. The GardenKit struct serves as the central configuration hub for the tapgarden package, and these new fields allow components like the BatchCaretaker to conditionally enable supply commitment functionality when the required dependencies are available.
1 parent 767b79b commit 9f03b39

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tapgarden/planter.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ import (
3131
"golang.org/x/exp/maps"
3232
)
3333

34+
// MintSupplyCommitter is used during minting to update the on-chain supply
35+
// commitment of a new minted asset.
36+
type MintSupplyCommitter interface {
37+
// SendMintEvent sends a mint event to the supply commitment state
38+
// machine.
39+
SendMintEvent(ctx context.Context, assetSpec asset.Specifier,
40+
leafKey universe.UniqueLeafKey,
41+
issuanceProof universe.Leaf) error
42+
}
43+
3444
// GardenKit holds the set of shared fundamental interfaces all sub-systems of
3545
// the tapgarden need to function.
3646
type GardenKit struct {
@@ -81,6 +91,15 @@ type GardenKit struct {
8191
// UniversePushBatchSize is the number of minted items to push to the
8292
// local universe in a single batch.
8393
UniversePushBatchSize int
94+
95+
// MintSupplyCommitter is used to commit the minting of new assets to
96+
// the supply commitment state machine.
97+
MintSupplyCommitter MintSupplyCommitter
98+
99+
// DelegationKeyChecker is used to verify that we control the delegation
100+
// key for a given asset, which is required for creating supply
101+
// commitments.
102+
DelegationKeyChecker address.DelegationKeyChecker
84103
}
85104

86105
// PlanterConfig is the main config for the ChainPlanter.

0 commit comments

Comments
 (0)