OSDN Git Service

delete some comments
authorChengcheng Zhang <943420582@qq.com>
Thu, 30 May 2019 12:36:31 +0000 (20:36 +0800)
committerChengcheng Zhang <943420582@qq.com>
Thu, 30 May 2019 12:36:31 +0000 (20:36 +0800)
test/integration/standard_transaction_test.go
test/util.go
wallet/wallet_test.go

index ee066a3..734d911 100644 (file)
@@ -1,12 +1,9 @@
 package integration
 
 import (
-       "encoding/hex"
        "encoding/json"
-       "fmt"
        "io/ioutil"
        "os"
-       "reflect"
        "testing"
 
        "github.com/vapor/account"
@@ -154,7 +151,6 @@ func TestP2SH(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
-       fmt.Println("TestP2SH1 hsm", hsm)
 
        xpub1, _, err := hsm.XCreate("TestP2SH1", "password", "en")
        if err != nil {
@@ -166,28 +162,15 @@ func TestP2SH(t *testing.T) {
                t.Fatal(err)
        }
 
-       // xpubers := make([]vcrypto.XPubKeyer, 2)
-       // xpubers[0] = xpub1.XPub
-       // xpubers[1] = xpub2.XPub
-       fmt.Println("TestP2SH xpub1.XPub", xpub1.XPub)
-       fmt.Println("TestP2SH xpub2.XPub", xpub2.XPub)
-
        testAccount, err := accountManager.Create([]vcrypto.XPubKeyer{xpub1.XPub, xpub2.XPub}, 2, "testAccount", signers.BIP0044)
-       // testAccount, err := accountManager.Create(xpubers, 2, "testAccount", signers.BIP0044)
        if err != nil {
                t.Fatal(err)
        }
-       fmt.Println("TestP2SH testAccount:", testAccount)
-       fmt.Println("TestP2SH testAccount.XPubs:", testAccount.XPubs)
-       fmt.Println("TestP2SH testAccount.XPubs[0]:", testAccount.XPubs[0])
-       // fmt.Println("TestP2SH testAccount.XPubs[1] type:", reflect.TypeOf(testAccount.XPubs[1]))
 
        controlProg, err := accountManager.CreateAddress(testAccount.ID, false)
        if err != nil {
                t.Fatal(err)
        }
-       fmt.Println("TestP2SH controlProg:", controlProg)
-       fmt.Println("TestP2SH controlProg:", hex.EncodeToString(controlProg.ControlProgram))
 
        utxo := test.MockUTXO(controlProg)
        tpl, tx, err := test.MockTx(utxo, testAccount)
@@ -195,13 +178,11 @@ func TestP2SH(t *testing.T) {
                t.Fatal(err)
        }
 
-       fmt.Println("TestP2SH no.1")
        // the number of sign transaction is equal to the count of xpub for account
        if _, err := test.MockSign(tpl, hsm, "password"); err != nil {
                t.Fatal(err)
        }
 
-       fmt.Println("TestP2SH no.2")
        if _, err := test.MockSign(tpl, hsm, "password"); err != nil {
                t.Fatal(err)
        }
@@ -316,13 +297,7 @@ func TestMutilNodeSign(t *testing.T) {
                t.Fatal(err)
        }
 
-       fmt.Println("TestMutilNodeSign xpub1 type:", reflect.TypeOf(*xpub1))
-       // xpubers := make([]vcrypto.XPubKeyer, 2)
-       // xpubers[0] = xpub1.XPub
-       // xpubers[1] = xpub2.XPub
-
        testAccount, err := accountManager.Create([]vcrypto.XPubKeyer{xpub1.XPub, xpub2.XPub}, 2, "testAccount", signers.BIP0044)
-       // testAccount, err := accountManager.Create(xpubers, 2, "testAccount", signers.BIP0044)
        if err != nil {
                t.Fatal(err)
        }
index 1a3cdfc..3e3851d 100644 (file)
@@ -2,7 +2,6 @@ package test
 
 import (
        "context"
-       "fmt"
        "time"
 
        "github.com/vapor/account"
@@ -76,10 +75,8 @@ func MockSign(tpl *txbuilder.Template, hsm *pseudohsm.HSM, password string) (boo
                return hsm.XSign(xpub, path, data[:], password)
        })
        if err != nil {
-               fmt.Println("MockSign err", err)
                return false, err
        }
-       fmt.Println("MockSign")
        return txbuilder.SignProgress(tpl), nil
 }
 
index 9ac69e3..83259c6 100644 (file)
@@ -1,9 +1,7 @@
 package wallet
 
 import (
-       "encoding/hex"
        "encoding/json"
-       "fmt"
        "io/ioutil"
        "os"
        "reflect"
@@ -18,7 +16,6 @@ import (
        "github.com/vapor/config"
        "github.com/vapor/consensus"
        vcrypto "github.com/vapor/crypto"
-       edchainkd "github.com/vapor/crypto/ed25519/chainkd"
        "github.com/vapor/database"
        dbm "github.com/vapor/database/leveldb"
        "github.com/vapor/event"
@@ -293,26 +290,22 @@ func TestMemPoolTxQueryLoop(t *testing.T) {
        if err != nil {
                t.Fatal(err)
        }
-       fmt.Println("TestMemPoolTxQueryLoop xpub1 is:", xpub1)
 
-       edXPub := edchainkd.XPub{}
-       edXPubKey, _ := hex.DecodeString("e0072a38408cfe4b70d322f8ed2d8acecab41615d2f091ddcd0d0622a8003de915569bd3e316d7e3c44ebebd21bfcc84f6428e60dbf17bef34f2e04a62f6cd2b")
-       copy(edXPub[:], edXPubKey[:])
-       xpub2 := pseudohsm.XPub{
-               Alias: "",
-               XPub:  edXPub,
-               File:  "",
-       }
+       // edXPub := edchainkd.XPub{}
+       // edXPubKey, _ := hex.DecodeString("e0072a38408cfe4b70d322f8ed2d8acecab41615d2f091ddcd0d0622a8003de915569bd3e316d7e3c44ebebd21bfcc84f6428e60dbf17bef34f2e04a62f6cd2b")
+       // copy(edXPub[:], edXPubKey[:])
+       // xpub2 := pseudohsm.XPub{
+       //      Alias: "",
+       //      XPub:  edXPub,
+       //      File:  "",
+       // }
        xpubers := make([]vcrypto.XPubKeyer, 1)
-       xpubers[0] = xpub2.XPub
+       xpubers[0] = xpub1.XPub
 
        testAccount, err := accountManager.Create(xpubers, 1, "testAccount", signers.BIP0044)
        if err != nil {
                t.Fatal(err)
        }
-       fmt.Println("TestMemPoolTxQueryLoop testAccount is:", testAccount)
-       fmt.Println("TestMemPoolTxQueryLoop testAccount xpubs is:", testAccount.XPubs[0])
-       fmt.Println("TestMemPoolTxQueryLoop testAccount xpubs type is:", reflect.TypeOf(testAccount.XPubs[0]))
 
        controlProg, err := accountManager.CreateAddress(testAccount.ID, false)
        if err != nil {