Skip to content

Commit

Permalink
fix(filter): chainsync: use resolved inputs in matching (#312)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 authored Jan 24, 2025
1 parent 7e44524 commit 39eb142
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions filter/chainsync/chainsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ func (c *ChainSync) Start() error {
for _, filterAddress := range c.filterAddresses {
isStakeAddress := strings.HasPrefix(filterAddress, "stake")
foundMatch := false
for _, output := range v.Outputs {
// Include resolved inputs as outputs for matching
allOutputs := append(v.Outputs, v.ResolvedInputs...)
for _, output := range allOutputs {
if output.Address().String() == filterAddress {
foundMatch = true
break
Expand Down Expand Up @@ -138,7 +140,9 @@ func (c *ChainSync) Start() error {
filterMatched := false
for _, filterPolicyId := range c.filterPolicyIds {
foundMatch := false
for _, output := range v.Outputs {
// Include resolved inputs as outputs for matching
allOutputs := append(v.Outputs, v.ResolvedInputs...)
for _, output := range allOutputs {
if output.Assets() != nil {
for _, policyId := range output.Assets().Policies() {
if policyId.String() == filterPolicyId {
Expand Down Expand Up @@ -166,7 +170,9 @@ func (c *ChainSync) Start() error {
filterMatched := false
for _, filterAssetFingerprint := range c.filterAssetFingerprints {
foundMatch := false
for _, output := range v.Outputs {
// Include resolved inputs as outputs for matching
allOutputs := append(v.Outputs, v.ResolvedInputs...)
for _, output := range allOutputs {
if output.Assets() != nil {
for _, policyId := range output.Assets().Policies() {
for _, assetName := range output.Assets().Assets(policyId) {
Expand Down

0 comments on commit 39eb142

Please sign in to comment.