Comments (9)
@Dhaiwat10 @nedsalk Can we close this?
from fuels-ts.
@Dhaiwat10 summed it up nicely in #1867 (comment). Typescript inferring string[]
instead of [string]
for ['0xabc']
is default behavior, but it'd be superseded by the generated typegen type which would constrain it to [string]
.
from fuels-ts.
@arboleya yes, as @petertonysmith94 showcased PredicateParams<T>
can already take in a generic which is used to type-constrain the inputs.
from fuels-ts.
Since we expect the data to satisfy the InputData[]
shape, I can't see how it could be a non-array.
Unless we'd define it as InputData | InputData[]
, it all depends on how this is expected on the Sway side of things.
cc @nedsalk
from fuels-ts.
I wonder if #1867 wouldn't also close this issue.
from fuels-ts.
@arboleya It doesn't close this issue.
#1867 references added the known types from the given generated ABI, and I believe this is referencing infer the types at a class level.
from fuels-ts.
Out of curiosity - how often is the API consumed in this way - whereby, the user isn't using the typegen?
bytecode = fs.readFile(...)
new Predicate({ bytecode, ... })
from fuels-ts.
This is not recommended, so I'd say almost never.
from fuels-ts.
I'd favour not implementing this change.
The typegen is adding known types to the predicate, therefore, this change only benefits users on this alternative instantiation path. IMO the following type inference is adequate for non-typegen instantiation.
or they may add the type themselves for a typed experience.
from fuels-ts.
Related Issues (20)
- Unused `OperationName` Enum Entries in the SDK HOT 2
- Transaction Failure Due to Non-Existent UTXO After Retry Attempt
- Fix integration / UI tests for `create-fuels` HOT 3
- Investigate options for registry cleanup HOT 1
- Implement token deployer contract in `create fuels` template
- Implement account connect / disconnect in `create fuels` HOT 1
- Implement UI testing in `create fuels` HOT 1
- Implement contract testing in `create fuels` HOT 1
- Investigate Why Test Files Are Being Ignored By Lint Script HOT 2
- Check for Blobs' existence before uploading them
- Abi - Refactor / Kickoff HOT 3
- Abi - Refactor / Parser
- Abi - Refactor / Coder
- Abi - Refactor / Gen HOT 1
- Abi - Refactor / Conclusion
- Typedoc secondary entrypoints rendered on the docs hub HOT 6
- Typegen producing inconsistent outputs between runs
- Add basic infra for benchmarks HOT 1
- Document Error for Failed Transaction Resubmission Due to Spent Resources HOT 2
- Upgrade to `[email protected]`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuels-ts.