OSDN Git Service

module claim
[bytom/vapor.git] / protocol / bc / types / map.go
index 9ad4037..99be153 100644 (file)
@@ -37,15 +37,6 @@ func MapTx(oldTx *TxData) *bc.Tx {
                        ord = 0
                case *bc.Claim:
                        ord = 0
-               case *bc.Dpos:
-                       ord = e.Ordinal
-                       //spentOutputIDs[*e.SpentOutputId] = true
-                       /*
-                               if *e.WitnessDestination.Value.AssetId == *consensus.BTMAssetID {
-                                       tx.GasInputIDs = append(tx.GasInputIDs, id)
-                               }
-                       */
-                       continue
                default:
                        continue
                }
@@ -72,7 +63,6 @@ func mapTx(tx *TxData) (headerID bc.Hash, hdr *bc.TxHeader, entryMap map[bc.Hash
 
        var (
                spends    []*bc.Spend
-               dposs     []*bc.Dpos
                issuances []*bc.Issuance
                coinbase  *bc.Coinbase
                claim     *bc.Claim
@@ -151,26 +141,6 @@ func mapTx(tx *TxData) (headerID bc.Hash, hdr *bc.TxHeader, entryMap map[bc.Hash
                                Ref:   &claimID,
                                Value: &inp.AssetAmount,
                        }
-               case *DposTx:
-                       // create entry for prevout
-                       prog := &bc.Program{VmVersion: inp.VMVersion, Code: inp.ControlProgram}
-                       src := &bc.ValueSource{
-                               Ref:      &inp.SourceID,
-                               Value:    &inp.AssetAmount,
-                               Position: inp.SourcePosition,
-                       }
-                       prevout := bc.NewOutput(src, prog, 0) // ordinal doesn't matter for prevouts, only for result outputs
-                       prevoutID := addEntry(prevout)
-                       // create entry for dpos
-                       dpos := bc.NewDpos(&prevoutID, uint64(i), uint32(inp.Type), inp.Stake, inp.From, inp.To, inp.Info)
-                       dpos.WitnessArguments = inp.Arguments
-                       dposID := addEntry(dpos)
-                       // setup mux
-                       muxSources[i] = &bc.ValueSource{
-                               Ref:   &dposID,
-                               Value: &inp.AssetAmount,
-                       }
-                       dposs = append(dposs, dpos)
                }
        }
 
@@ -186,12 +156,6 @@ func mapTx(tx *TxData) (headerID bc.Hash, hdr *bc.TxHeader, entryMap map[bc.Hash
                issuance.SetDestination(&muxID, issuance.Value, issuance.Ordinal)
        }
 
-       // connect the inputs to the mux
-       for _, dpos := range dposs {
-               spentOutput := entryMap[*dpos.SpentOutputId].(*bc.Output)
-               dpos.SetDestination(&muxID, spentOutput.Source.Value, dpos.Ordinal)
-       }
-
        if coinbase != nil {
                coinbase.SetDestination(&muxID, mux.Sources[0].Value, 0)
        }