OSDN Git Service

adjust code position
authoroys <oys@oysdeMacBook-Pro.local>
Wed, 25 Sep 2019 02:32:04 +0000 (10:32 +0800)
committeroys <oys@oysdeMacBook-Pro.local>
Wed, 25 Sep 2019 02:32:04 +0000 (10:32 +0800)
protocol/vm/vmutil/script.go

index ac067e7..4aca640 100644 (file)
@@ -15,6 +15,15 @@ var (
        ErrMultisigFormat = errors.New("bad multisig program format")
 )
 
+// DexContractArgs is a struct for dex contract arguments
+type DexContractArgs struct {
+       RequestedAsset   bc.AssetID
+       RatioMolecule    int64
+       RatioDenominator int64
+       SellerProgram    []byte
+       SellerKey        ed25519.PublicKey
+}
+
 // IsUnspendable checks if a contorl program is absolute failed
 func IsUnspendable(prog []byte) bool {
        return len(prog) > 0 && prog[0] == byte(vm.OP_FAIL)
@@ -137,15 +146,6 @@ func checkMultiSigParams(nrequired, npubkeys int64) error {
        return nil
 }
 
-// DexContractArgs is a struct for dex contract arguments
-type DexContractArgs struct {
-       RequestedAsset   bc.AssetID
-       RatioMolecule    int64
-       RatioDenominator int64
-       SellerProgram    []byte
-       SellerKey        ed25519.PublicKey
-}
-
 // P2WDCProgram return the segwit pay to dex contract
 func P2WDCProgram(dexContractArgs DexContractArgs) ([]byte, error) {
        builder := NewBuilder()