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

feat: adding set timestamp method to starknet provider #46

Merged
merged 24 commits into from
Jul 3, 2022

Conversation

johnson2427
Copy link
Contributor

@johnson2427 johnson2427 commented Jun 29, 2022

What I did

Added set_timestamp for the starknet provider. Currently unable to hit the RPC endpoint for setting the timestamp of the block

fixes: #43

How I did it

Took similar methods from ape-hardhat and used requests package to hit the localhost endpoint for now. This call is currently failing. Also added a test under tests.function.test_provider

How to verify it

Cannot do this yet

Checklist

  • Passes all linting checks (pre-commit and CI jobs)
  • New test cases have been added and are passing
  • Documentation has been updated
  • PR title follows Conventional Commit standard (will be automatically included in the changelog)

@antazoey
Copy link
Contributor

failing tests seem unrelated, will try to fix on other branch

@johnson2427
Copy link
Contributor Author

@unparalleled-js I'll need another approval I think, I just set up a pytest.skip for test_set_timestamp so it isn't included in the run.

Copy link
Contributor Author

@johnson2427 johnson2427 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing crazy here. Just looking through our changes. LGTM

def test_set_timestamp(provider, account, contract):
start_time = provider.get_block("pending").timestamp
provider.set_timestamp(start_time + 8600)
contract.increase_balance(account.address, 123, sender=account)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just stole this from a test above

Copy link
Contributor

@ca11ab1e ca11ab1e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@antazoey antazoey mentioned this pull request Jun 30, 2022
4 tasks
@antazoey
Copy link
Contributor

antazoey commented Jul 1, 2022

update on my side, been stuck all day on this bug causing the failing tests.
I have some updates but can't push yet.

I have realized that the starknet-devnet process works a lot better when run separately, likely the same issues preventing Foundry from working. (ApeWorX/ape-foundry#5) since it is the same base class.

@antazoey antazoey merged commit 9d5f62a into main Jul 3, 2022
@antazoey antazoey deleted the feat/set_timestamp branch July 3, 2022 17:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set_timestamp support
3 participants