aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/oracle_contracts.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-04-16 13:12:36 +0800
committerGitHub <noreply@github.com>2019-04-16 13:12:36 +0800
commite4d7cf4a54187832ec26424e1dcfa5918e64c480 (patch)
tree38c747150a94a9a20391d37cb2947e71b27118ee /core/vm/oracle_contracts.go
parent35be27df35e31ba95a8540b4e1173e29aee4e61a (diff)
downloaddexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar.gz
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar.bz2
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar.lz
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar.xz
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.tar.zst
dexon-e4d7cf4a54187832ec26424e1dcfa5918e64c480.zip
core: vm: fix emitReported (#367)
Diffstat (limited to 'core/vm/oracle_contracts.go')
-rw-r--r--core/vm/oracle_contracts.go21
1 files changed, 15 insertions, 6 deletions
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)
}