-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: implement support for new ABI error codes #3894
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
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
907a098
wip
Torres-ssf f8fb50f
re-add all forc projects to forc.toml file
Torres-ssf 0bbe347
use forc 0.68.6
Torres-ssf a2c3df8
add errorCodes to both JsonAbi interfaces
Torres-ssf 92ba410
add more errors to the script error
Torres-ssf b6ee1da
Merge branch 'master' into st/feat/abi-errors
Torres-ssf de3479a
using forc 0.68.7
Torres-ssf b2e6137
add new signal error
Torres-ssf 393ceaa
adjust forc version to 0.68.7
Torres-ssf baaead7
lint forc file
Torres-ssf 2bb037e
add more errors to script error program
Torres-ssf ace2232
add property abis to IExtractTxError interface
Torres-ssf 49645b3
implement helper
Torres-ssf 525b2ad
implement helper assembleSignalErrorMessage
Torres-ssf 892fe62
implement helper assembleRevertError
Torres-ssf c77a07d
using property abis when calling extractTxErrorHelper
Torres-ssf 4076ec2
add test cases for TX revert with new Sway errors
Torres-ssf 6061ee8
add experimental flag to forc format
Torres-ssf aa87651
add experimental flag to forc forcBuildFlags
Torres-ssf 49337a3
update forc version on internal apps
Torres-ssf 2caf104
adjusting types names
Torres-ssf 09aea67
fix import
Torres-ssf b5a16ab
fix import
Torres-ssf e0bb649
remove testing JSON ABI
Torres-ssf c818a18
remove unnecessary file
Torres-ssf 8e4484a
get error codes at transpiler
Torres-ssf 8a5390a
adjusting types for error pos property
Torres-ssf 8cb2ea7
add changeset
Torres-ssf 6808a00
update forc fmt command for forc-check script
Torres-ssf e29d2de
delete empty file
Torres-ssf 24f10f9
code refact
Torres-ssf 6b3623b
adjusting helper params to avoid breaking change
Torres-ssf 4155d0b
lint
Torres-ssf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@fuel-ts/transactions": patch | ||
"@fuel-ts/abi-typegen": patch | ||
"@fuel-ts/abi-coder": patch | ||
"@fuel-ts/versions": patch | ||
"@fuel-ts/account": patch | ||
"@fuel-ts/program": patch | ||
"@internal/forc": patch | ||
--- | ||
|
||
feat: implement support for new ABI error codes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
channel = "testnet" | ||
|
||
[components] | ||
forc = "0.68.6" | ||
forc = "0.68.7" | ||
fuel-core = "0.43.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.68.6 | ||
0.68.7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { IErrorCode } from '../../types/interfaces/IErrorCode'; | ||
|
||
export class ErrorCode { | ||
public code: string; | ||
public value: IErrorCode['value']; | ||
|
||
constructor(params: IErrorCode) { | ||
this.code = params.code; | ||
this.value = params.value; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { JsonAbiErrorCode } from './JsonAbi'; | ||
|
||
export interface IErrorCode { | ||
code: string; | ||
value: JsonAbiErrorCode; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ErrorCode } from '../abi/errors/ErrorCode'; | ||
import type { IErrorCode } from '../types/interfaces/IErrorCode'; | ||
|
||
export function makeErrorCode(params: IErrorCode) { | ||
return new ErrorCode(params); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { ErrorCode } from '../abi/errors/ErrorCode'; | ||
import type { IType } from '../types/interfaces/IType'; | ||
import type { JsonAbiErrorCode } from '../types/interfaces/JsonAbi'; | ||
|
||
import { makeErrorCode } from './makeErrorCodes'; | ||
|
||
export function parseErrorCodes(params: { | ||
types: IType[]; | ||
rawErrorCodes?: Record<string, JsonAbiErrorCode>; | ||
}) { | ||
// const { types, rawErrorCodes } = params; | ||
const { rawErrorCodes } = params; | ||
const errorCodes: ErrorCode[] = Object.entries(rawErrorCodes ?? {}).map(([code, value]) => | ||
makeErrorCode({ code, value }) | ||
); | ||
|
||
return errorCodes; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.