continue
}
- if ord >= uint64(len(oldTx.Inputs)) {
- continue
+ if ord < uint64(len(oldTx.Inputs)) {
+ tx.InputIDs[ord] = id
}
- tx.InputIDs[ord] = id
}
for id := range spentOutputIDs {
}
prevout := bc.NewIntraChainOutput(src, prog, 0) // ordinal doesn't matter
- outputID := bc.EntryID(prevout)
+ mainchainOutputID := addEntry(prevout)
assetDefHash := bc.NewHash(sha3.Sum256(inp.AssetDefinition))
assetDef := &bc.AssetDefinition{
Data: &assetDefHash,
IssuanceProgram: &bc.Program{
- VmVersion: inp.VMVersion,
+ VmVersion: inp.IssuanceVMVersion,
Code: inp.IssuanceProgram,
},
}
- crossIn := bc.NewCrossChainInput(&outputID, &inp.AssetAmount, prog, uint64(i), assetDef)
+ crossIn := bc.NewCrossChainInput(&mainchainOutputID, prog, uint64(i), assetDef)
crossIn.WitnessArguments = inp.Arguments
crossInID := addEntry(crossIn)
muxSources[i] = &bc.ValueSource{
}
for _, crossIn := range crossIns {
- crossIn.SetDestination(&muxID, crossIn.Value, crossIn.Ordinal)
+ mainchainOutput := entryMap[*crossIn.MainchainOutputId].(*bc.IntraChainOutput)
+ crossIn.SetDestination(&muxID, mainchainOutput.Source.Value, crossIn.Ordinal)
}
if coinbase != nil {
case out.OutputType() == VoteOutputType:
// non-retirement vote tx
- voteOut, _ := out.TypedOutput.(*VoteTxOutput)
+ voteOut, _ := out.TypedOutput.(*VoteOutput)
prog := &bc.Program{out.VMVersion(), out.ControlProgram()}
o := bc.NewVoteOutput(src, prog, uint64(i), voteOut.Vote)
resultID = addEntry(o)