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

Add starknetjs compatibilty tests to CI #1195

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

petscheit
Copy link
Contributor

@petscheit petscheit commented Oct 16, 2023

This introduces some tests to ensure compatibility with the starknet-js package. This PR completes #1148

The corresponding testing code has been moved to this repo

Pull Request type

Please add the labels corresponding to the type of changes your PR introduces:

  • Testing

What is the new behavior?

This PR introduces the following tests

  • Declare and deploy v0 & v1 contracts to madara
  • Read state from smart contacts & via provider api
  • Invoke transactions & decode events
  • Estimate fees for declare, deploy and invoke

@petscheit petscheit force-pushed the test/add-js-tests branch 2 times, most recently from dc95379 to f1f062d Compare October 16, 2023 13:34
@d-roak
Copy link
Collaborator

d-roak commented Oct 16, 2023

Let's not add the js in the Madara main repo, we can create an action in a separate repo and call it here in the workflow

@petscheit
Copy link
Contributor Author

Sure thing, let me know to which repo I should add this

@petscheit
Copy link
Contributor Author

Ok, I moved the tests to a different repo.

One of the tests is failing, I don't really understand why that is the case. The fee is severely underestimated for contracts that are declared in genesis. This error does not pop up for contracts I declare during runtime and I check the fee estimation the same way across the different tests. How do we proceed here?

@d-roak
Copy link
Collaborator

d-roak commented Oct 18, 2023

cc @tdelabro
also, can we create a repo for the action inside the keep-starknet-strange org?

.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
@tdelabro
Copy link
Collaborator

tdelabro commented Oct 19, 2023

can we create a repo for the action inside the keep-starknet-strange org?

yes we will when it's ready

.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
.github/workflows/pull-request.yml Outdated Show resolved Hide resolved
.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
.github/workflows/starknet-js-tests.yml Outdated Show resolved Hide resolved
@petscheit petscheit requested review from d-roak and tdelabro October 20, 2023 12:35
@tdelabro
Copy link
Collaborator

@petscheit I would happily merge it in its current state, but the test is failing

@petscheit
Copy link
Contributor Author

Was being super dumb on Friday, I just pushed the action, so lets include this one also.

Regarding the failing test, yup. You need to tell me how to proceed, as I'm measuring the results, and the fee estimation seems to be wrong for genesis contracts.

@tdelabro
Copy link
Collaborator

@d-roak can you review and approve ?

@tdelabro
Copy link
Collaborator

@petscheit https://github.com/keep-starknet-strange/madara/actions/runs/6611182918
The tests are not runing anymore. Github action config files are broken

@petscheit
Copy link
Contributor Author

Hmm so the issue is that my action is a workflow correct? And doesn't seem to work. This is what I was struggling with on Friday. Any ideas how to get around this?

@tdelabro
Copy link
Collaborator

https://github.com/keep-starknet-strange/madara/actions/runs/6611182918
says:


Invalid workflow file: .github/workflows/push.yml#L35
invalid value workflow reference: references to workflows must be rooted in '.github/workflows'

It just look like you missformated you workflow file

Copy link
Collaborator

@d-roak d-roak left a comment

Choose a reason for hiding this comment

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

applying both suggestions should fix it

.github/workflows/pull-request.yml Outdated Show resolved Hide resolved
.github/workflows/push.yml Outdated Show resolved Hide resolved
@d-roak
Copy link
Collaborator

d-roak commented Oct 24, 2023

we won't merge it until it's green like a lettuce 🥬
@tdelabro any clue why we are having issues with the estimated fees?

@tdelabro
Copy link
Collaborator

nope. @petscheit started investigating it. But he will be busy IRL soon, so he can open and issue with his current advancement and someone will pick it up from there

@petscheit
Copy link
Contributor Author

OK issue fixed, nothing wrong with madara.

starknetjs didnt document that you have to pass the constructor calldata for the deploy estimation ( I thought it would be derived via ABI). When I add it, everything works correctly. I also opened a PR on starknetjs to update the docs.

@petscheit petscheit requested review from d-roak and tdelabro October 25, 2023 09:04
@tdelabro
Copy link
Collaborator

@d-roak do you approve?

Copy link
Collaborator

@d-roak d-roak left a comment

Choose a reason for hiding this comment

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

On this side it's good. The changelog line should be added either in the beginning or the end, but since it's not standardized, the end result will be the same

I would feel more comfortable using the keep-starknet-strange/madara-js-tests before merging, but if u don't think it's necessary, u can merge it @tdelabro

@petscheit
Copy link
Contributor Author

yeah we can also transfer the repo now, and update the repo link in this PR.

@tdelabro
Copy link
Collaborator

@petscheit ok lets do this. Ping me on tg when you did the transfer request

@tdelabro tdelabro merged commit 281a12f into keep-starknet-strange:main Oct 26, 2023
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2023
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.

3 participants