diff --git a/internal/executor/contracts/governance.go b/internal/executor/contracts/governance.go index bb70f2d..376896d 100644 --- a/internal/executor/contracts/governance.go +++ b/internal/executor/contracts/governance.go @@ -12,7 +12,6 @@ import ( "github.com/meshplus/bitxhub-model/constant" "github.com/meshplus/bitxhub-model/pb" "github.com/meshplus/bitxhub/internal/repo" - "github.com/tidwall/gjson" ) type Governance struct { @@ -126,8 +125,7 @@ func (g *Governance) SubmitProposal(from, eventTyp, des, typ, objId string, extr } // 3. lock low-priority proposals - chainId := gjson.Get(string(extra), "id").String() - lockPId, err := g.lockLowPriorityProposal(chainId, eventTyp) + lockPId, err := g.lockLowPriorityProposal(objId, eventTyp) if err != nil { return boltvm.Error("close low priority proposals error:" + err.Error()) } diff --git a/internal/executor/contracts/governance_test.go b/internal/executor/contracts/governance_test.go index d21712f..ea1916f 100644 --- a/internal/executor/contracts/governance_test.go +++ b/internal/executor/contracts/governance_test.go @@ -562,9 +562,9 @@ func TestGovernance_SubmitProposal_LockLowPriorityProposal(t *testing.T) { mockStub.EXPECT().AddObject(gomock.Any(), gomock.Any()).AnyTimes() mockStub.EXPECT().CurrentCaller().Return("").AnyTimes() - res := g.SubmitProposal(idExistent, string(governance.EventUpdate), "des", string(AppchainMgr), "objId", chainData) + res := g.SubmitProposal(idExistent, string(governance.EventUpdate), "des", string(AppchainMgr), appchainMethod, chainData) assert.False(t, res.Ok, string(res.Result)) - res = g.SubmitProposal(idExistent, string(governance.EventLogout), "des", string(AppchainMgr), "objId", chainData) + res = g.SubmitProposal(idExistent, string(governance.EventLogout), "des", string(AppchainMgr), appchainMethod, chainData) assert.True(t, res.Ok, string(res.Result)) }