def _per_era_supply(self, block_height):
coins = <NUM_LIT:0><EOL>for era in self.supply_data['<STR_LIT>']:<EOL><INDENT>end_block = era['<STR_LIT:end>']<EOL>start_block = era['<STR_LIT:start>']<EOL>reward = era['<STR_LIT>']<EOL>if not end_block or block_height <= end_block:<EOL><INDENT>blocks_this_era = block_height - start_block<EOL>coins += blocks_this_era * reward<EOL>break<EOL><DEDENT>blocks_per_era = end_block - start_block<EOL>coins += reward * blocks_per_era<EOL><DEDENT>return coins<EOL>
Calculate the coin supply based on 'eras' defined in crypto_data. Some
currencies don't have a simple algorithmically defined halfing schedule
so coins supply has to be defined explicitly per era.