Gets the block CONFIRMATION_BLOCKS in the past and returns its block hash
(self)
| 1084 | ) |
| 1085 | |
| 1086 | def get_confirmed_blockhash(self) -> BlockHash: |
| 1087 | """Gets the block CONFIRMATION_BLOCKS in the past and returns its block hash""" |
| 1088 | confirmed_block_number = BlockNumber( |
| 1089 | self.web3.eth.block_number - self.default_block_num_confirmations |
| 1090 | ) |
| 1091 | if confirmed_block_number < 0: |
| 1092 | confirmed_block_number = BlockNumber(0) |
| 1093 | |
| 1094 | return self.blockhash_from_blocknumber(confirmed_block_number) |
| 1095 | |
| 1096 | def blockhash_from_blocknumber(self, block_number: BlockIdentifier) -> BlockHash: |
| 1097 | """Given a block number, query the chain to get its corresponding block hash""" |