Example #1
0
    def mockup_product(self):
        private_key = ECCipher.create_private_key(self.account.privateKey)
        public_key = ECCipher.create_public_key_from_private_key(private_key)
        public_key = ECCipher.serialize_public_key(public_key)

        price = randint(1, 10000) * 0.01
        return {
            'description': 'stress testing description',
            'signature':
            '304502201b31544ff65ebbfff3743a0b2536388e1f6cf2533de4bbf0ffab57d762f54d50022100a8101face8c6a6d2f0e01a9a01ea49d80598c880872db9e3c1e9eb27a23a2554',
            'cover_image': 'upload_images/20181127072441_13.png',
            'end_date': '2018-12-04T15:24:41.664517Z',
            'msg_hash': 'dRFWYcWC9TKujDo7mLiUCq00MthHezzkyncAGIdaEos=',
            'id': 53,
            'start_date': '2018-11-27T15:24:41.664517Z',
            'ptype': 'file',
            'seq': 0,
            'owner_address': public_key,
            'tags': 'stress testing tags',
            'price': price,
            'title': 'stress testing product',
            'category': 'stress testing category',
            'status': 0,
            'created': '2018-11-27T07:24:41.715315Z'
        }
Example #2
0
 def __init__(self, eth_account):
     self.private_key = ECCipher.create_private_key(eth_account.privateKey)
     public_key = ECCipher.create_public_key_from_private_key(self.private_key)
     self.public_key = ECCipher.serialize_public_key(public_key)
     # self.address = eth_account.address
     self.address = ECCipher.get_address_from_public_key(public_key)