Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Contracts: Enabled signed extension #14565

Merged
merged 6 commits into from
Jul 21, 2023
Merged

Conversation

pgherveou
Copy link
Contributor

@pgherveou pgherveou commented Jul 12, 2023

Ideally we fix my other PR #14563 so we can have a test that verify that an Ink contract compiled with 1.70 works properly

@pgherveou pgherveou requested a review from athei as a code owner July 12, 2023 14:11
@pgherveou pgherveou requested a review from a team July 12, 2023 14:11
@pgherveou pgherveou changed the base branch from master to pg/ink_in_test July 12, 2023 14:11
@athei
Copy link
Member

athei commented Jul 14, 2023

have a test that verify that an Ink contract compiled with 1.70 works properly

Ideally, pallet-contracts should not depend on ink! at all or even know about its existence. Therefore tests should not use ink!. It is enough to write a wat fixture that uses the new instructions. There is no reason to assume that ink! does anything different than emitting those instructions.

@pgherveou
Copy link
Contributor Author

fair I will close the other PR and rebase this one on master

@pgherveou pgherveou force-pushed the pg/signed_extension branch from 4b3c5c4 to 164b885 Compare July 14, 2023 08:15
@pgherveou pgherveou changed the base branch from pg/ink_in_test to master July 14, 2023 08:15
@pgherveou pgherveou added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit labels Jul 14, 2023
Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

How's this tested or do we have a wat fixture for this in master already?

@pgherveou
Copy link
Contributor Author

How's this tested or do we have a wat fixture for this in master already?

@xermicus what kind of .wat do we write to proof that we support signed_extension?

@xermicus
Copy link
Member

xermicus commented Jul 14, 2023

Probably something very similar to what wasmi uses to test it should work

(module
	(import "env" "memory" (memory 1 1))
	(func (export "deploy"))
	(func (export "call"))
	(func (param i32) (result i32)
		local.get 0
		i32.extend8_s
	)
)

frame/contracts/fixtures/sign_extension.wat Outdated Show resolved Hide resolved
frame/contracts/src/tests.rs Outdated Show resolved Hide resolved
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
Copy link
Contributor

@juangirini juangirini left a comment

Choose a reason for hiding this comment

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

LGTM I don't give it the green check mark cause of @agryaznov's comment

@pgherveou pgherveou requested a review from agryaznov July 21, 2023 09:09
@pgherveou
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit aacf416 into master Jul 21, 2023
@paritytech-processbot paritytech-processbot bot deleted the pg/signed_extension branch July 21, 2023 11:39
Ank4n pushed a commit that referenced this pull request Jul 22, 2023
* Contracts enable signed extension

* Add test

* fix

* xx

* Update frame/contracts/fixtures/sign_extension.wat

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>

* move tests

---------

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
ascjones pushed a commit that referenced this pull request Jul 24, 2023
* Contracts enable signed extension

* Add test

* fix

* xx

* Update frame/contracts/fixtures/sign_extension.wat

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>

* move tests

---------

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
SkymanOne pushed a commit that referenced this pull request Jul 24, 2023
* Contracts enable signed extension

* Add test

* fix

* xx

* Update frame/contracts/fixtures/sign_extension.wat



* move tests

---------

Co-authored-by: PG Herveou <pgherveou@gmail.com>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants