From bcd5eb102b0c3ff7584c65dfc3d4a9a44d5bc131 Mon Sep 17 00:00:00 2001 From: scorpiotzh <835598264@qq.com> Date: Mon, 18 Jul 2022 11:32:08 +0800 Subject: [PATCH] Merge branch 'dev' # Conflicts: # go.mod # go.sum --- txtool/create_sub_account_script.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/txtool/create_sub_account_script.go b/txtool/create_sub_account_script.go index e5113f5b..5ee0d896 100644 --- a/txtool/create_sub_account_script.go +++ b/txtool/create_sub_account_script.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/dotbitHQ/das-lib/common" "github.com/dotbitHQ/das-lib/core" + "github.com/dotbitHQ/das-lib/molecule" "github.com/dotbitHQ/das-lib/smt" "github.com/dotbitHQ/das-lib/txbuilder" "github.com/dotbitHQ/das-lib/witness" @@ -39,15 +40,15 @@ func (s *SubAccountTxTool) BuildCreateSubAccountTxByScript(p *ParamBuildCreateSu txParams.OtherWitnesses = append(txParams.OtherWitnesses, customScriptConfigWit) // get price - //builderConfigCellSub, err := s.DasCore.ConfigCellDataBuilderByTypeArgs(common.ConfigCellTypeArgsSubAccount) - //if err != nil { - // return nil, fmt.Errorf("ConfigCellDataBuilderByTypeArgs err: %s", err.Error()) - //} - //newRate, err := molecule.Bytes2GoU32(builderConfigCellSub.ConfigCellSubAccount.NewSubAccountCustomPriceDasProfitRate().RawData()) - //if err != nil { - // return nil, fmt.Errorf("NewSubAccountCustomPriceDasProfitRate err: %s", err.Error()) - //} - newRate := uint32(2000) + builderConfigCellSub, err := s.DasCore.ConfigCellDataBuilderByTypeArgs(common.ConfigCellTypeArgsSubAccount) + if err != nil { + return nil, fmt.Errorf("ConfigCellDataBuilderByTypeArgs err: %s", err.Error()) + } + newRate, err := molecule.Bytes2GoU32(builderConfigCellSub.ConfigCellSubAccount.NewSubAccountCustomPriceDasProfitRate().RawData()) + if err != nil { + return nil, fmt.Errorf("NewSubAccountCustomPriceDasProfitRate err: %s", err.Error()) + } + //newRate := uint32(2000) resPrice, err := GetCustomScriptMintTotalCapacity(&ParamCustomScriptMintTotalCapacity{ Action: common.DasActionCreateSubAccount, //PriceApi: &PriceApiDefault{},