Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feature-full-tx'
Browse files Browse the repository at this point in the history
  • Loading branch information
uldaman committed Jul 17, 2018
2 parents a3d97f1 + 87a3135 commit 6fb0382
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gear/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,22 @@ def eth_getTransactionReceipt(tx_hash):


@dispatcher.add_method
def eth_getBlockByHash(block_hash, full_tx=True):
'''
full_tx 该参数仅为了与以太坊兼容, thor 中无用
'''
def eth_getBlockByHash(block_hash, full_tx=False):
logger.info('eth_getBlockByHash')
return thor.get_block(normalize_block_identifier(block_hash))
return get_block(block_hash, full_tx)


@dispatcher.add_method
def eth_getBlockByNumber(block_number, full_tx=True):
'''
full_tx 该参数仅为了与以太坊兼容, thor 中无用
'''
def eth_getBlockByNumber(block_number, full_tx=False):
logger.info('eth_getBlockByNumber')
return thor.get_block(normalize_block_identifier(block_number))
return get_block(block_number, full_tx)


def get_block(block_identifier, full_tx):
blk = thor.get_block(normalize_block_identifier(block_identifier))
if blk and full_tx:
blk["transactions"] = [eth_getTransactionByHash(tx) for tx in blk["transactions"]]
return blk

@dispatcher.add_method
def eth_newBlockFilter():
Expand Down

0 comments on commit 6fb0382

Please sign in to comment.