From e4d7cf4a54187832ec26424e1dcfa5918e64c480 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Tue, 16 Apr 2019 13:12:36 +0800 Subject: core: vm: fix emitReported (#367) --- core/vm/oracle_contracts.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'core/vm/oracle_contracts.go') diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index c82fed3cf..1fa66cefb 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -1109,7 +1109,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, @@ -1182,28 +1182,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) } -- cgit v1.2.3