def doit(self, printWire=False, ops=None):
     if ops is None:
         ops = [Operation(self.op)]
     tx = Signed_Transaction(ref_block_num=self.ref_block_num,
                             ref_block_prefix=self.ref_block_prefix,
                             expiration=self.expiration,
                             operations=ops)
     tx = tx.sign([self.wif], chain=self.prefix)
     tx.verify([PrivateKey(self.wif, prefix=u"STM").pubkey], self.prefix)
     txWire = hexlify(py23_bytes(tx)).decode("ascii")
 def doit(self, printWire=False, ops=None):
     ops = [Operation(ops)]
     tx = Signed_Transaction(ref_block_num=self.ref_block_num,
                             ref_block_prefix=self.ref_block_prefix,
                             expiration=self.expiration,
                             operations=ops)
     start = timer()
     tx = tx.sign([self.wif], chain=self.prefix)
     end1 = timer()
     tx.verify([PrivateKey(self.wif, prefix=u"STM").pubkey], self.prefix)
     end2 = timer()
     return end2 - end1, end1 - start
Esempio n. 3
0
 def test_verify_transaction(self):
     stm = self.stm
     block = Block(22005665, steem_instance=stm)
     trx = block.transactions[28]
     signed_tx = Signed_Transaction(trx)
     key = signed_tx.verify(chain=stm.chain_params, recover_parameter=False)
     public_key = format(Base58(key[0]), stm.prefix)
     self.assertEqual(public_key, "STM4tzr1wjmuov9ftXR6QNv7qDWsbShMBPQpuwatZsfSc5pKjRDfq")
Esempio n. 4
0
def get_signer(trx):
    try:
        st = Signed_Transaction(trx.copy())
    except Exception:
        return None

    keys = []
    for key in st.verify(recover_parameter=True):
        keys.append(format(Base58(key, prefix='STM'), 'STM'))
    return keys
Esempio n. 5
0
 def test_verify_transaction(self):
     stm = self.stm
     block = Block(22005665, steem_instance=stm)
     trx = block.transactions[28]
     signed_tx = Signed_Transaction(trx)
     key = signed_tx.verify(chain=stm.chain_params, recover_parameter=False)
     public_key = format(Base58(key[0]), stm.prefix)
     self.assertEqual(
         public_key,
         "STM4xA6aCu23rKxsEZWF2xVYJvJAyycuoFxBRQEuQ5Hc7UtFET7fT")
Esempio n. 6
0
                                                            "voter"]:
                                                    transaction = tt
                                            elif isinstance(op, list) and len(
                                                    op
                                            ) > 1 and op[0][:4] == "vote":
                                                if op[1]["voter"] == vote[
                                                        "voter"]:
                                                    transaction = tt
                                    block_cnt += 1
                                vote_did_sign = True
                                key_accounts = []
                                if transaction is not None:
                                    signed_tx = Signed_Transaction(transaction)
                                    public_keys = []
                                    for key in signed_tx.verify(
                                            chain=stm.chain_params,
                                            recover_parameter=True):
                                        public_keys.append(
                                            format(
                                                Base58(key, prefix=stm.prefix),
                                                stm.prefix))

                                    empty_public_keys = []
                                    for key in public_keys:
                                        pubkey_account = wallet.getAccountFromPublicKey(
                                            key)
                                        if pubkey_account is None:
                                            empty_public_keys.append(key)
                                        else:
                                            key_accounts.append(pubkey_account)
                                if len(key_accounts) > 0: