diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-04-16 13:12:36 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-15 22:09:56 +0800 |
commit | d2d9bf406c77281008115c1b377c58594c2a23be (patch) | |
tree | 622e79b7fc5c80c496022f04cdb22e6919066544 | |
parent | ed345b0fdfec596774e7be1b99618326dedcb93c (diff) | |
download | go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar.gz go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar.bz2 go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar.lz go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar.xz go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.tar.zst go-tangerine-d2d9bf406c77281008115c1b377c58594c2a23be.zip |
core: vm: fix emitReported (#367)
-rw-r--r-- | core/vm/oracle_contracts.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index 55ea3f4dd..9adf98e53 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -1107,7 +1107,7 @@ func (s *GovernanceState) emitConfigurationChangedEvent() { }) } -// event CRSProposed(uint256 round, bytes32 crs); +// event CRSProposed(uint256 indexed Round, bytes32 CRS); func (s *GovernanceState) emitCRSProposed(round *big.Int, crs common.Hash) { s.StateDB.AddLog(&types.Log{ Address: GovernanceContractAddress, @@ -1180,28 +1180,37 @@ func (s *GovernanceState) emitNodeRemoved(nodeAddr common.Address) { }) } -// event ForkReported(address indexed NodeAddress, address indexed Type, bytes Arg1, bytes Arg2); +// event Reported(address indexed NodeAddress, uint256 Type, bytes Arg1, bytes Arg2); func (s *GovernanceState) emitReported(nodeAddr common.Address, reportType *big.Int, arg1, arg2 []byte) { - t, err := abi.NewType("bytes", nil) + t1, err := abi.NewType("uint256", nil) + if err != nil { + panic(err) + } + t2, err := abi.NewType("bytes", nil) if err != nil { panic(err) } arg := abi.Arguments{ abi.Argument{ + Name: "ReportType", + Type: t1, + Indexed: false, + }, + abi.Argument{ Name: "Arg1", - Type: t, + Type: t2, Indexed: false, }, abi.Argument{ Name: "Arg2", - Type: t, + Type: t2, Indexed: false, }, } - data, err := arg.Pack(arg1, arg2) + data, err := arg.Pack(reportType, arg1, arg2) if err != nil { panic(err) } |