diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-25 17:33:39 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 64932c8ccf85754da0631f736967bf36dc41e213 (patch) | |
tree | 1bc52a2a3006b4db8849457bf81f9eed5b94cdcc /core/vm/governance.go | |
parent | f47b66ba18a52a9c1aab11dc3278455b2c288818 (diff) | |
download | dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar.gz dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar.bz2 dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar.lz dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar.xz dexon-64932c8ccf85754da0631f736967bf36dc41e213.tar.zst dexon-64932c8ccf85754da0631f736967bf36dc41e213.zip |
core: vm: Add amount to undelegate event (#176)
Diffstat (limited to 'core/vm/governance.go')
-rw-r--r-- | core/vm/governance.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/vm/governance.go b/core/vm/governance.go index b400ba61b..684e22104 100644 --- a/core/vm/governance.go +++ b/core/vm/governance.go @@ -1442,12 +1442,12 @@ func (s *GovernanceStateHelper) emitDelegated(nodeAddr, delegatorAddr common.Add }) } -// event Undelegated(address indexed NodeAddress, address indexed DelegatorAddress); -func (s *GovernanceStateHelper) emitUndelegated(nodeAddr, delegatorAddr common.Address) { +// event Undelegated(address indexed NodeAddress, address indexed DelegatorAddress, uint256 Amount); +func (s *GovernanceStateHelper) emitUndelegated(nodeAddr, delegatorAddr common.Address, amount *big.Int) { s.StateDB.AddLog(&types.Log{ Address: GovernanceContractAddress, Topics: []common.Hash{events["Undelegated"].Id(), nodeAddr.Hash(), delegatorAddr.Hash()}, - Data: []byte{}, + Data: common.BigToHash(amount).Bytes(), }) } @@ -1883,7 +1883,7 @@ func (g *GovernanceContract) undelegateHelper(nodeAddr, caller common.Address) ( // Subtract to network total staked. g.state.DecTotalStaked(delegator.Value) - g.state.emitUndelegated(nodeAddr, caller) + g.state.emitUndelegated(nodeAddr, caller, delegator.Value) return g.useGas(100000) } |