def test_performance(): import wallet import struct from eoslib import N from eostypes import PySignedTransaction, PyMessage import time ts = PySignedTransaction() ts.reqire_scope(b'test') ts.reqire_scope(b'currency') data = struct.pack("QQQ", N(b'currency'), N(b'test'), 1) for i in range(900): msg = PyMessage() msg.init(b'currency', b'transfer', [[b'currency',b'active']], data) ts.add_message(msg) print('++++ push_transaction2') start = time.time() eosapi.push_transaction2(ts, True) print('cost:',time.time() - start) print('++++ produce_block') start = time.time() with producer: pass print('cost:',time.time() - start)
def test_ts(): import wallet from eostypes import PySignedTransaction, PyMessage import time print('hello') ts = PySignedTransaction() ts.reqire_scope(b'test') ts.reqire_scope(b'currency') data = struct.pack("QQQ", N(b'currency'), N(b'test'), 50) for i in range(10): msg = PyMessage() msg.init(b'currency', b'transfer', [[b'currency', b'active']], data) ts.add_message(msg) # print('+++++++++++++:',ts.get_messages()) # ret = wallet.sign_transaction(ts) # print('sign ts return',ret) # r = eosapi.get_table('test','currency','account') # print(r) start = time.time() eosapi.push_transaction2(ts, True) print('cost:', time.time() - start) start = time.time() with producer: pass print('cost:', time.time() - start)