"math"
"github.com/bytom/vapor/application/mov/common"
+ "github.com/bytom/vapor/consensus/segwit"
dbm "github.com/bytom/vapor/database/leveldb"
"github.com/bytom/vapor/protocol/bc"
"github.com/bytom/vapor/protocol/bc/types"
Utxo *common.MovUtxo
RatioNumerator int64
RatioDenominator int64
+ BlockHeight uint64
+ TxIndex uint64
}
func calcOrderKey(fromAssetID, toAssetID *bc.AssetID, utxoHash *bc.Hash, rate float64) []byte {
return nil, err
}
+ contractArgs, err := segwit.DecodeP2WMCProgram(orderData.Utxo.ControlProgram)
+ if err != nil {
+ return nil, err
+ }
+
orders = append(orders, &common.Order{
FromAssetID: orderAfter.FromAssetID,
ToAssetID: orderAfter.ToAssetID,
Utxo: orderData.Utxo,
RatioNumerator: orderData.RatioNumerator,
RatioDenominator: orderData.RatioDenominator,
+ BlockHeight: orderData.BlockHeight,
+ TxIndex: orderData.TxIndex,
+ SellerProgram: contractArgs.SellerProgram,
})
}
return orders, nil
Utxo: order.Utxo,
RatioNumerator: order.RatioNumerator,
RatioDenominator: order.RatioDenominator,
+ BlockHeight: order.BlockHeight,
+ TxIndex: order.TxIndex,
}
data, err := json.Marshal(orderData)
if err != nil {