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

Add feature for enabling decoding #59

Merged
merged 7 commits into from
Feb 4, 2021
Merged

Add feature for enabling decoding #59

merged 7 commits into from
Feb 4, 2021

Conversation

ascjones
Copy link
Contributor

@ascjones ascjones commented Jan 29, 2021

Possible solution for #58, reverting #35

If the decode or std feature is enabled then PortableForm::String will be an owned String which allow decoding. Otherwise it will be a &'static str (this is required for substrate runtimes).

todo

  • test it out with substrate
  • test it out with ink!

@Robbepop
Copy link
Contributor

Robbepop commented Feb 2, 2021

test it out with ink!

not sure there is a need for it, is there?

@ascjones
Copy link
Contributor Author

ascjones commented Feb 2, 2021

test it out with ink!

not sure there is a need for it, is there?

Just wanted to make absolutely sure before merging and cutting a release. See use-ink/ink#672

Copy link
Contributor

@Robbepop Robbepop left a comment

Choose a reason for hiding this comment

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

thanks for the PR! this is definitely a big improvement over the previous design.

Comment on lines -59 to -67
/// Trait for types which can be used to represent strings in type definitions.
pub trait FormString:
AsRef<str> + PartialEq + Eq + PartialOrd + Ord + Clone + Debug
{
}

impl FormString for &'static str {}
impl FormString for String {}

Copy link
Contributor

Choose a reason for hiding this comment

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

glad it is gone

@ascjones ascjones merged commit f0f689b into master Feb 4, 2021
@ascjones ascjones deleted the aj-decode-feature branch February 4, 2021 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants