Skip to content

Commit

Permalink
Export index and id in effects table
Browse files Browse the repository at this point in the history
  • Loading branch information
Amisha Singla authored and Amisha Singla committed Jul 9, 2024
1 parent b3fb467 commit 69bd714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/transform/effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"reflect"
"sort"
"strconv"
"strings"

"github.com/guregu/null"
"github.com/stellar/go/amount"
Expand Down Expand Up @@ -158,6 +159,8 @@ func (operation *transactionOperationWrapper) effects() ([]EffectOutput, error)
for i := range wrapper.effects {
wrapper.effects[i].LedgerClosed = operation.ledgerClosed
wrapper.effects[i].LedgerSequence = operation.ledgerSequence
wrapper.effects[i].EffectIndex = uint32(i)
wrapper.effects[i].EffectId = strings.Join([]string{strconv.FormatInt(wrapper.effects[i].OperationID, 10), strconv.FormatUint(uint64(wrapper.effects[i].EffectIndex), 10)}, "-")
}

return wrapper.effects, nil
Expand Down
2 changes: 2 additions & 0 deletions internal/transform/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ type EffectOutput struct {
TypeString string `json:"type_string"`
LedgerClosed time.Time `json:"closed_at"`
LedgerSequence uint32 `json:"ledger_sequence"`
EffectIndex uint32 `json:"index"`
EffectId string `json:"id"`
}

// EffectType is the numeric type for an effect
Expand Down

0 comments on commit 69bd714

Please sign in to comment.