-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore!: support new ABI format #2747
Conversation
Coverage Report:
Changed Files:
|
"abiVersion": "1", | ||
"specVersion": "1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the new spec and incoming PR:
- the
abiVersion
property was removed (unnecessary) - the
encoding
was renamed toencodingVersion
(can be done in this PR as well)
We should have a basic switch approach (or similar) in place to lock the pattern for dealing with [future] different versions of specVersion
, such as we have for encodingVersion
.
@danielbate Thoughts?
/** | |
* Retrieves the appropriate encoding function for a given encoding version. | |
* | |
* @param encoding - the version to provide a strategy for. | |
* @throws for an unsupported encoding version. | |
* @returns the appropriate encoding strategy. | |
*/ | |
export function getCoderForEncoding(encoding: EncodingVersion = ENCODING_V1): GetCoderFn { | |
switch (encoding) { | |
case ENCODING_V1: | |
return getCoderV1; | |
default: | |
throw new FuelError( | |
ErrorCode.UNSUPPORTED_ENCODING_VERSION, | |
`Encoding version ${encoding} is unsupported.` | |
); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A switch/strategy SGTM. It's been sound through development.
Superseded by: |
Release notes
In this release, we:
Summary
This PR adds support for the new ABI specification.
Breaking Changes
TBD
Checklist
tests
to prove my changesdocs