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

Girazoki runtime 901 moonbase alpha approval fix #974

Merged

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Nov 9, 2021

What does it do?

Provides hotfix for the approval precompile that was already merge in master.

PR that brought the fix in master: #963

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

* pallet-assets fixing error matching

* Add erc20 instance contract

* TS tests with flag to true

* More typescript tests

* prettier

* EditorConfig

* Modify integration tests
@girazoki girazoki added the B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes label Nov 9, 2021
Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

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

Looks basically good. Made a comment about a few weight accounting removals to be sure they were on purpose.

Comment on lines -416 to -417
gasometer.record_cost(RuntimeHelper::<Runtime>::db_read_gas_cost())?;
gasometer.record_cost(RuntimeHelper::<Runtime>::db_write_gas_cost())?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They were wrong. I think they were left-overs from when we were using a local approval storage and not the pallet one. Now the db writes assocaited with the pallet-storage should be returned by the dispatch call itself

assetId = context.polkadotApi.createType(
"AssetId",
new BN("42259045809535163221576417993425387648")
);
Copy link
Contributor

Choose a reason for hiding this comment

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

assetId could be deduced by the result of registerAsset.
Otherwise it would be more readable to declare this number as a constant: const testAssetId=new BN("42259045809535163221576417993425387648")

Copy link
Contributor

@joelamouche joelamouche left a comment

Choose a reason for hiding this comment

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

Added a fw comments on how to improve the ts test. looks great overall though!

data: data,
},
]);
let amount = new BN(100000000000000);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be better to derive amount here and in the registration from the same constant, making the test easier to modify and understand

@girazoki
Copy link
Collaborator Author

girazoki commented Nov 9, 2021

@joelamouche can we create a JIRA-tickets for test improvements? I dont want to add to the hotfix branch something that is not in master

@joelamouche
Copy link
Contributor

Sure pls create a ticket and add details pls

@girazoki
Copy link
Collaborator Author

girazoki commented Nov 9, 2021

@crystalin
Copy link
Collaborator

@girazoki
Approving this PR, this is now branch perm-runtime-901

@crystalin crystalin closed this Nov 10, 2021
@crystalin
Copy link
Collaborator

Actually, let's rebase on runtime-901 and merge

@crystalin crystalin reopened this Nov 10, 2021
@crystalin crystalin changed the base branch from runtime-901-moonbase-alpha-approval-hotfix to perm-runtime-901 November 10, 2021 01:09
@crystalin crystalin merged commit b493846 into perm-runtime-901 Nov 10, 2021
@crystalin crystalin deleted the girazoki-runtime-901-moonbase-alpha-approval-fix branch November 10, 2021 01:48
@crystalin crystalin added the A8-mergeoncegreen Pull request is reviewed well. label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A8-mergeoncegreen Pull request is reviewed well. B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants