def test_Transfer(self): transferJson = { 'from': 'test', 'to': 'test1', 'amount': "1.000 STEEM", 'memo': 'foobar' } t = Transfer(transferJson) self.assertEqual(transferJson, json.loads(str(t))) self.assertEqual(transferJson, t.json()) self.assertEqual(transferJson, t.toJson()) self.assertEqual(transferJson, t.__json__()) transferJson = { 'from': 'test', 'to': 'test1', 'amount': ['3000', 3, '@@000000037'], 'memo': 'foobar' } t = Transfer(transferJson) self.assertEqual(transferJson, json.loads(str(t))) self.assertEqual(transferJson, t.json()) self.assertEqual(transferJson, t.toJson()) self.assertEqual(transferJson, t.__json__()) o = Operation(Transfer(transferJson)) self.assertEqual(o.json()[1], transferJson) tx = { 'ref_block_num': 0, 'ref_block_prefix': 0, 'expiration': '2018-04-07T09:30:53', 'operations': [o], 'extensions': [], 'signatures': [] } s = Signed_Transaction(tx) s.sign(wifkeys=[wif], chain="STEEMAPPBASE") self.assertEqual(s.json()["operations"][0][1], transferJson)
def test_Operation(self): a = {"amount": '1000', "precision": 3, "nai": '@@000000013'} j = ["transfer", {'from': 'a', 'to': 'b', 'amount': a, 'memo': 'c'}] o = Operation(j) self.assertEqual(o.json()[1], j[1])
def test_Operation(self): a = ['1000', 3, '@@000000013'] j = ["transfer", {'from': 'a', 'to': 'b', 'amount': a, 'memo': 'c'}] o = Operation(j) self.assertEqual(o.json()[1], j[1])