OSDN Git Service

Merge remote-tracking branch 'origin/v0.1' into asset
[bytom/vapor.git] / test / wallet_test_util.go
index fa70846..b03b430 100644 (file)
@@ -85,14 +85,6 @@ func (t *wtTransaction) create(ctx *walletTestContext) (*types.Tx, error) {
                        if err := generator.AddSpendInput(input.AccountAlias, input.AssetAlias, input.Amount); err != nil {
                                return nil, err
                        }
-               case "issue":
-                       _, err := ctx.createAsset(input.AccountAlias, input.AssetAlias)
-                       if err != nil {
-                               return nil, err
-                       }
-                       if err := generator.AddIssuanceInput(input.AssetAlias, input.Amount); err != nil {
-                               return nil, err
-                       }
                }
        }
 
@@ -148,14 +140,6 @@ func (ctx *walletTestContext) getPubkey(keyAlias string) *chainkd.XPub {
        return nil
 }
 
-func (ctx *walletTestContext) createAsset(accountAlias string, assetAlias string) (*asset.Asset, error) {
-       acc, err := ctx.Wallet.AccountMgr.FindByAlias(accountAlias)
-       if err != nil {
-               return nil, err
-       }
-       return ctx.Wallet.AssetReg.Define(acc.XPubs, len(acc.XPubs), nil, 0, assetAlias, nil)
-}
-
 func (ctx *walletTestContext) newBlock(txs []*types.Tx, coinbaseAccount string) (*types.Block, error) {
        controlProgram, err := ctx.createControlProgram(coinbaseAccount, true)
        if err != nil {
@@ -183,7 +167,7 @@ func (ctx *walletTestContext) createAccount(name string, keys []string, quorum i
 }
 
 func (ctx *walletTestContext) update(block *types.Block) error {
-       if err := SolveAndUpdate(ctx.Chain, block); err != nil {
+       if _, err := ctx.Chain.ProcessBlock(block); err != nil {
                return err
        }
        if err := ctx.Wallet.AttachBlock(block); err != nil {