diff --git a/app/services/fee/distributor/distributor.go b/app/services/fee/distributor/distributor.go index 4f5ecce9..e12800a5 100644 --- a/app/services/fee/distributor/distributor.go +++ b/app/services/fee/distributor/distributor.go @@ -79,12 +79,12 @@ func New(members []string, treasuryID string, treasuryRewardPercentage int, vali } // CalculateMemberDistribution Returns the transactions to the members and the treasury -func (s Service) CalculateMemberDistribution(validTreasuryFee, validValdiatorFee int64) ([]transfer.Hedera, error) { - feePerAccount := validValdiatorFee / int64(len(s.accountIDs)) +func (s Service) CalculateMemberDistribution(validTreasuryFee, validValidatorFee int64) ([]transfer.Hedera, error) { + feePerAccount := validValidatorFee / int64(len(s.accountIDs)) totalValidatorAmount := feePerAccount * int64(len(s.accountIDs)) - if totalValidatorAmount != validValdiatorFee { - s.logger.Errorf("Provided validator fee [%d] is not divisible.", validValdiatorFee) + if totalValidatorAmount != validValidatorFee { + s.logger.Errorf("Provided validator fee [%d] is not divisible.", validValidatorFee) return nil, errors.New("amount not divisible") } diff --git a/e2e/helper/expected/fee.go b/e2e/helper/expected/fee.go index c53cee80..b758419e 100644 --- a/e2e/helper/expected/fee.go +++ b/e2e/helper/expected/fee.go @@ -25,7 +25,7 @@ import ( "github.com/limechain/hedera-eth-bridge-validator/app/domain/service" ) -func ReceiverAndFeeAmounts(feeCalc service.Fee, distributor service.Distributor, token string, amount int64) (receiverAmount, valdiatorsFee, treasuryFee int64) { +func ReceiverAndFeeAmounts(feeCalc service.Fee, distributor service.Distributor, token string, amount int64) (receiverAmount, validatorsFee, treasuryFee int64) { fee, remainder := feeCalc.CalculateFee(token, amount) validTreasuryFee, validValidatorsFee := distributor.ValidAmounts(fee) validFee := validTreasuryFee + validValidatorsFee