Use better deposit logging at info (#1528)

* Use better logging at info

* Update service_test.go
This commit is contained in:
Preston Van Loon 2019-02-08 16:25:35 -05:00 committed by Raul Jordan
parent 7078382b82
commit 031a9c96b9
2 changed files with 5 additions and 6 deletions

View File

@ -242,7 +242,7 @@ func (w *Web3Service) ProcessLog(VRClog gethTypes.Log) {
// the ETH1.0 chain by trying to ascertain which participant deposited
// in the contract.
func (w *Web3Service) ProcessDepositLog(VRClog gethTypes.Log) {
merkleRoot, depositData, MerkleTreeIndex, merkleBranch, err := contracts.UnpackDepositLogData(VRClog.Data)
merkleRoot, depositData, MerkleTreeIndex, _, err := contracts.UnpackDepositLogData(VRClog.Data)
if err != nil {
log.Errorf("Could not unpack log %v", err)
return
@ -266,10 +266,9 @@ func (w *Web3Service) ProcessDepositLog(VRClog gethTypes.Log) {
}
index := binary.BigEndian.Uint64(MerkleTreeIndex)
log.WithFields(logrus.Fields{
"publicKey": depositInput.Pubkey,
"merkle tree index": index,
"merkle branch": merkleBranch,
}).Info("Validator registered in VRC with public key and index")
"publicKey": fmt.Sprintf("%#x", depositInput.Pubkey),
"merkleTreeIndex": index,
}).Info("Validator registered in deposit contract")
validDepositsCount.Inc()
}

View File

@ -460,7 +460,7 @@ func TestProcessDepositLog(t *testing.T) {
testutil.AssertLogsDoNotContain(t, hook, "Could not unpack log")
testutil.AssertLogsDoNotContain(t, hook, "Could not save in trie")
testutil.AssertLogsDoNotContain(t, hook, "Could not decode deposit input")
testutil.AssertLogsContain(t, hook, "Validator registered in VRC with public key and index")
testutil.AssertLogsContain(t, hook, "Validator registered in deposit contract")
hook.Reset()
}