Exemplo n.º 1
0
    def _sign_with_secret_cli(self, unsigned_tx: str, sequence: int) -> str:
        with temp_file(unsigned_tx) as unsigned_tx_path:
            res = secretcli_sign(unsigned_tx_path, self.multisig.address,
                                 self.multisig.name, self.account_num,
                                 sequence)

        return res
Exemplo n.º 2
0
    def _create_multisig(self, unsigned_tx: str, signatures: List[str]) -> str:
        """Takes all the signatures of the signers from the db and generates the signed tx with them."""

        # creates temp-files containing the signatures, as the 'multisign' command requires files as input
        with temp_file(unsigned_tx) as unsigned_tx_path:
            with temp_files(signatures, self.logger) as signed_tx_paths:
                return multisig_tx(unsigned_tx_path, self.multisig_name,
                                   *signed_tx_paths)
Exemplo n.º 3
0
    def _broadcast(self, signed_tx) -> str:
        self._check_remaining_funds()

        # Note: This operation costs Scrt
        with temp_file(signed_tx) as signed_tx_path:
            return json.loads(broadcast(signed_tx_path))['txhash']
Exemplo n.º 4
0
 def _broadcast(signed_tx) -> str:
     # Note: This operation costs Scrt
     with temp_file(signed_tx) as signed_tx_path:
         return json.loads(broadcast(signed_tx_path))['txhash']