コード例 #1
0
def single_sign_transaction(input_private_key: str, tx: Transaction):
    data = tx.serialize_unsigned()
    signature = keytool.ecdsa_sign(bytes.fromhex(input_private_key), data)
    r = b""
    r = serialize.write_var_bytes(r, signature)
    tx.programs[0].parameter = r
    tx.hash()
    return tx
コード例 #2
0
def single_sign_transaction(keystore: KeyStore, tx: Transaction):
    data = tx.serialize_unsigned()
    signature = keytool.ecdsa_sign(keystore.private_key, data)
    r = b""
    r = serialize.write_var_bytes(r, signature)
    tx.programs[0].parameter = r
    tx.hash()
    return tx