Skip to content

Commit 04e724c

Browse files
mdj3333cn
mdj33
authored andcommitted
fix ut
1 parent b67d450 commit 04e724c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

build/docker-compose.sh

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ function base_init() {
101101

102102
sed -i $sedfix 's/^enableTLS=.*/enableTLS=true/g' ${testtoml}
103103

104+
#autonomy config
105+
sed -i $sedfix 's/^autonomyExec =.*/autonomyExec=""/g' chain33.toml
106+
104107
cp ${testtoml} ${testtomlsolo}
105108
#consens
106109
consens_init "solo"

system/dapp/manage/executor/exec.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ func (c *Manage) Exec_Modify(manageAction *types.ModifyConfig, tx *types.Transac
3030
types.AssertConfig(c.GetAPI())
3131
cfg := c.GetAPI().GetConfig()
3232

33-
if cfg.IsDappFork(c.GetHeight(), mty.ManageX, mty.ForkManageAutonomyEnable) {
33+
confManager := types.ConfSub(cfg, mty.ManageX)
34+
autonomyExec := confManager.GStr(types.AutonomyCfgKey)
35+
if cfg.IsDappFork(c.GetHeight(), mty.ManageX, mty.ForkManageAutonomyEnable) && len(autonomyExec) > 0 {
3436
return nil, errors.Wrapf(types.ErrNotAllow, "not allow this op directly in new version")
3537
}
3638

system/dapp/manage/executor/rpc_test.go

-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"testing"
55

66
rpctypes "github.com/33cn/chain33/rpc/types"
7-
mty "github.com/33cn/chain33/system/dapp/manage/types"
87
"github.com/33cn/chain33/types"
98
"github.com/33cn/chain33/util"
109
"github.com/33cn/chain33/util/testnode"
@@ -13,9 +12,7 @@ import (
1312

1413
func TestManageConfig(t *testing.T) {
1514
cfg := testnode.GetDefaultConfig()
16-
cfg.SetTitleOnlyForTest("chain33")
1715
mocker := testnode.NewWithConfig(cfg, nil)
18-
mocker.GetAPI().GetConfig().SetDappFork(mty.ManageX, mty.ForkManageAutonomyEnable, types.MaxHeight)
1916
defer mocker.Close()
2017
mocker.Listen()
2118
err := mocker.SendHot()
@@ -155,9 +152,7 @@ func TestManageConfig(t *testing.T) {
155152

156153
func TestTokenFinisher(t *testing.T) {
157154
cfg := testnode.GetDefaultConfig()
158-
cfg.SetTitleOnlyForTest("chain33")
159155
mocker := testnode.NewWithConfig(cfg, nil)
160-
mocker.GetAPI().GetConfig().SetDappFork(mty.ManageX, mty.ForkManageAutonomyEnable, types.MaxHeight)
161156
defer mocker.Close()
162157
mocker.Listen()
163158
err := mocker.SendHot()

types/defaultcfg.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ superManager=[
222222
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",
223223
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
224224
]
225-
autonomyExec="autonomy"
225+
autonomyExec=""
226226
227227
[exec.sub.autonomy]
228228
total="16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"

0 commit comments

Comments
 (0)