Пример #1
0
 def get_fee(self):
     """ Override parent method to calc multisend-specific fee: (n_txs - 1) * 5 units """
     base_fee = super().get_fee()
     recipients_fee = MinterHelper.pybcmul(
         (len(self.txs) - 1) * self.COMMISSION_PER_RECIPIENT,
         self.FEE_DEFAULT_MULTIPLIER)
     return int(MinterHelper.pybcadd(base_fee, recipients_fee))
Пример #2
0
    def get_fee(self):
        """
        Get fee of transaction in PIP.
        Returns:
            int
        """

        # Multiplied gas comission in PIP
        gas_price = MinterHelper.pybcmul(self.COMMISSION,
                                         self.FEE_DEFAULT_MULTIPLIER)

        # Comission for payload and service_data bytes
        comission = MinterHelper.pybcadd(
            MinterHelper.pybcmul(len(self.payload),
                                 self.FEE_DEFAULT_MULTIPLIER),
            MinterHelper.pybcmul(len(self.service_data),
                                 self.FEE_DEFAULT_MULTIPLIER))

        return int(MinterHelper.pybcadd(gas_price, comission))