Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace consensus version calls #597

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

hweawer
Copy link
Contributor

@hweawer hweawer commented Jan 23, 2025

What

get rid of self.report_contract.get_consensus_version()

Things to consider

I can't replace it in:

    def _check_contract_versions(self, blockstamp: ReferenceBlockStamp):
        """
        Check if Oracle can process report on reference blockstamp.
        """
        self._check_compatability(blockstamp.block_hash)
        self._check_compatability('latest')

    def _check_compatability(self, block_tag: BlockIdentifier):
        contract_version = self.report_contract.get_contract_version(block_tag)
        consensus_version = self.report_contract.get_consensus_version(block_tag)

        compatibility = (contract_version, consensus_version) in self.COMPATIBLE_ONCHAIN_VERSIONS

        if not compatibility:
            raise IncompatibleOracleVersion(
                f'Incompatible Oracle version. Block tag: {repr(block_tag)}. '
                f'Expected (Contract, Consensus) versions: {', '.join(repr(v) for v in self.COMPATIBLE_ONCHAIN_VERSIONS)}, '
                f'Got ({contract_version}, {consensus_version})'
            )

@hweawer hweawer self-assigned this Jan 23, 2025
@F4ever F4ever merged commit 3376919 into feat/oracle-v5 Jan 24, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants