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

New optional parameter to set time #355

Closed
mikiw opened this issue Feb 20, 2024 · 2 comments · Fixed by #362
Closed

New optional parameter to set time #355

mikiw opened this issue Feb 20, 2024 · 2 comments · Fixed by #362
Assignees
Labels
enhancement New feature or request

Comments

@mikiw
Copy link
Contributor

mikiw commented Feb 20, 2024

Add an optional parameter to set time feature that will skip block generation when the time is set so the next transaction will be generated with the exact time

@mikiw mikiw self-assigned this Feb 20, 2024
@FabijanC
Copy link
Contributor

Perhaps the optional parameter should be a boolean generate_block that is by default true

@FabijanC FabijanC added the enhancement New feature or request label Feb 20, 2024
@mikiw
Copy link
Contributor Author

mikiw commented Feb 26, 2024

devnet in py next_block_start_time logic:

    def next_block(self, block_info: BlockInfo, general_config: StarknetGeneralConfig):
        """
        Returns the next block info with the correct timestamp
        """
        if self.next_block_start_time is None:
            block_timestamp = now() + self.block_timestamp_offset
        else:
            block_timestamp = self.next_block_start_time
            self.block_timestamp_offset = block_timestamp - now()
            self.next_block_start_time = None

        return BlockInfo(
            gas_price=self.gas_price,
            block_number=block_info.block_number,
            block_timestamp=block_timestamp,
            sequencer_address=general_config.sequencer_address,
            starknet_version=CAIRO_LANG_VERSION,
        )

@mikiw mikiw linked a pull request Feb 28, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants