Skip to content

Commit 39eb142

Browse files
authored
fix(filter): chainsync: use resolved inputs in matching (#312)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 7e44524 commit 39eb142

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

filter/chainsync/chainsync.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func (c *ChainSync) Start() error {
107107
for _, filterAddress := range c.filterAddresses {
108108
isStakeAddress := strings.HasPrefix(filterAddress, "stake")
109109
foundMatch := false
110-
for _, output := range v.Outputs {
110+
// Include resolved inputs as outputs for matching
111+
allOutputs := append(v.Outputs, v.ResolvedInputs...)
112+
for _, output := range allOutputs {
111113
if output.Address().String() == filterAddress {
112114
foundMatch = true
113115
break
@@ -138,7 +140,9 @@ func (c *ChainSync) Start() error {
138140
filterMatched := false
139141
for _, filterPolicyId := range c.filterPolicyIds {
140142
foundMatch := false
141-
for _, output := range v.Outputs {
143+
// Include resolved inputs as outputs for matching
144+
allOutputs := append(v.Outputs, v.ResolvedInputs...)
145+
for _, output := range allOutputs {
142146
if output.Assets() != nil {
143147
for _, policyId := range output.Assets().Policies() {
144148
if policyId.String() == filterPolicyId {
@@ -166,7 +170,9 @@ func (c *ChainSync) Start() error {
166170
filterMatched := false
167171
for _, filterAssetFingerprint := range c.filterAssetFingerprints {
168172
foundMatch := false
169-
for _, output := range v.Outputs {
173+
// Include resolved inputs as outputs for matching
174+
allOutputs := append(v.Outputs, v.ResolvedInputs...)
175+
for _, output := range allOutputs {
170176
if output.Assets() != nil {
171177
for _, policyId := range output.Assets().Policies() {
172178
for _, assetName := range output.Assets().Assets(policyId) {

0 commit comments

Comments
 (0)