@ -158,20 +158,16 @@ func getAmountFromDelegateMessage(receipt *hmytypes.Receipt, data []byte) (*type
} )
} )
}
}
stkAmoun t := stkMsg . Amount
deductedAm t := stkMsg . Amount
logs := hmytypes . FindLogsWithTopic ( receipt , staking . DelegateTopic )
logs := hmytypes . FindLogsWithTopic ( receipt , staking . DelegateTopic )
for _ , log := range logs {
for _ , log := range logs {
if len ( log . Data ) > ethcommon . AddressLength {
if len ( log . Data ) > ethcommon . AddressLength && log . Address == stkMsg . DelegatorAddress {
validatorAddress := ethcommon . BytesToAddress ( log . Data [ : ethcommon . AddressLength ] )
// Remove re-delegation amount as funds were never credited to account's balance.
if log . Address == stkMsg . DelegatorAddress && stkMsg . ValidatorAddress == validatorAddress {
deductedAmt = new ( big . Int ) . Sub ( deductedAmt , new ( big . Int ) . SetBytes ( log . Data [ ethcommon . AddressLength : ] ) )
// Remove re-delegation amount as funds were never credited to account's balance.
stkAmount = new ( big . Int ) . Sub ( stkAmount , new ( big . Int ) . SetBytes ( log . Data [ ethcommon . AddressLength : ] ) )
break
}
}
}
}
}
return & types . Amount {
return & types . Amount {
Value : negativeBigValue ( stkAmoun t) ,
Value : negativeBigValue ( deductedAmt ) ,
Currency : & common . NativeCurrency ,
Currency : & common . NativeCurrency ,
} , nil
} , nil
}
}