- spentOutput := tx.Entries[*e.SpentOutputId].(*bc.IntraChainOutput)
- a1 := spentOutput.Source.Value.AssetId.Bytes()
- assetID = &a1
- amount = &spentOutput.Source.Value.Amount
- destPos = &e.WitnessDestination.Position
- s := e.SpentOutputId.Bytes()
- spentOutputID = &s
+ switch spentOutput := tx.Entries[*e.SpentOutputId].(type) {
+ case *bc.IntraChainOutput:
+ a1 := spentOutput.Source.Value.AssetId.Bytes()
+ assetID = &a1
+ amount = &spentOutput.Source.Value.Amount
+ destPos = &e.WitnessDestination.Position
+ s := e.SpentOutputId.Bytes()
+ spentOutputID = &s
+ case *bc.VoteOutput:
+ a1 := spentOutput.Source.Value.AssetId.Bytes()
+ assetID = &a1
+ amount = &spentOutput.Source.Value.Amount
+ destPos = &e.WitnessDestination.Position
+ s := e.SpentOutputId.Bytes()
+ spentOutputID = &s
+ }