## Description
Merges the two libraries. They were initially separate to separate the
core logic and fuel vm specific functionality, but that separation is no
longer maintained so having a merged library is better.
Closes#6708
## Checklist
- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
---------
Co-authored-by: Sophie <47993817+sdankel@users.noreply.github.com>
Co-authored-by: Igor Rončević <ironcev@hotmail.com>
## Description
This PR sets the "new encoding" (from now on will be called "encoding
v1") as the default. We can still disable it using `no_encoding_v1`,
which switches back to "encoding v0".
Actions that needs to be done after this being merged will exist in
https://github.com/FuelLabs/sway/issues/5727
New features
- ABI Super traits;
- AbiEncode buffer dynamic sizing;
Bugs Fixed
- `ContractCall` intrinsic interaction effect was not set correctly;
Fixing warnings and error messages
- Better error message when core-lib is not available for
scripts/contracts/predicates;
- Better error message when main inputs/outputs are unknown or error
types;
- Better error message when main inputs/outputs do not implement
AbiEncode/AbiDecode;
- Don't warn impurity attributes on the "__entry" fn;
- Don't warn CEI on the "__entry" fn. Our CEI analysis, currently, does
not recognize `Never`. This means it does not realize it is impossible
to call two contract functions;
Test Disabled (needs to be enabled again in the future)
- should_pass/language/name_resolution_after_monomorphization
- should_pass/language/shadowing/shadowed_glob_imports
- should_pass/language/name_resolution_inside_intrinsics
- sdk-harness/external_proxy test is not working. I am assuming it is
the LDC bug that is already fixed on version 0.25. What is happening is
that the literal "double_value" has the correct length, but some random
data. Which makes the method selector fails. Only after we call LDC. The
proxy contract is working.
Test generating more warnings than before
- should_pass/dca/contract/superabi_contract_calls
What happens here is that when we implement a trait for `Contract`, we
actually generate two functions: one prefixed `__contract_entry` that is
called by the method selector; and another one normal, that can be
called freely. So, if the trait method is never called manually, it is
marked as dead.
- should_pass/dca/contract/abi_fn_params
I actually think the new warning is correct and nothing here needs to be
done.
Test with fewer warnings than before
- should_pass/dca/unused_fields
auto-impl is making all fields being used. so no dead code warnings are
being generated. We need to fix this.
Changes to std-lib
- Functions that return data about call context changed the semantic.
`first_param` and `second_param` return the value as the VM sees them.
We now have `called_method` and `called_args`. This means that we can
change the protocol later and still keep these four functions always
working and with meaningful names.
-
- predicate_data also was updated to use encoding v1 protocol.
ICE
- increase_buffer_if_needed implementation is a little bit strange
because does not work as a method inside `Buffer`. For some reason, it
is generating an ICE. I need to create an issue so we can fix, and
improve the implementation here.
- `Buffer` used by AbiEncode needs a `push_bytes` so we can be more
efficient when encoding Bytes and others.
## Checklist
- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
## Description
Implement https://github.com/FuelLabs/sway-rfcs/pull/23
Closes https://github.com/FuelLabs/sway/issues/3419 (technically via the
RFC)
Closes https://github.com/FuelLabs/sway/issues/3202
Closes https://github.com/FuelLabs/sway/issues/3043
Closes https://github.com/FuelLabs/sway/issues/2639
Closes https://github.com/FuelLabs/sway/issues/2465
Closes https://github.com/FuelLabs/sway/issues/4304
This is a big one but mostly removes stuff. It's hard to review but the
summary of changes below should be sufficient. Most of the changes here
are things that I just had to do to make CI pass.
- Removed the `--experimental-storage` flag and made its
[behavior](https://github.com/FuelLabs/sway/pull/4297) the default. Also
removed everything that was required for the previous storage APIs in
favour of the new ones.
- Break down the `std::storage` into multiple submodules:
- `storage_key` implements the API for `std::core::StorageKey`
- `storage_api` implements the free functions `read` (previously `get`),
`write` (previously `store`), and `clear`.
- 4 more modules for the dynamic storage types which now use the new
`StorageKey` API.
- `#[storage(write)]` now allows reading from storage as well. This is
needed because the way we pack structs in storage now requires that we
sometimes read from storage first if we were to write a portion of a
slot.
- Removed the "storage only types" checks and the corresponding tests.
- Removed the `__get_storage_key` intrinsic and the `get_storage_key` IR
instruction and all corresponding tests. Also removed the `state_index`
metadata as it is no longer required.
- Added tests and example to showcase nested storage maps and nested
storage vectors.
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
## Description
This moves the examples workspace manifest introduced in #4118 into the
`examples/` directory and cleans it up a bit.
We also now integrate the examples workspace into CI, making the old
`examples-checker` script redundant. This old script is also removed as
a part of this PR.
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
Closes#1078
* New trait `From<T>` in a new library called `convert.rs`
* Most changes are trivial
* Added `From` to the prelude
* Had to modify `from()` in `U128`, `U256`, and `B512` to take a tuple
of components instead of multiple arguments to conform to the trait.
This is a breaking change of course.
* Updating lock files for all the examples.
Each instruction within a function is inspected and if storage
operations are found they are confirmed to match the function `storage`
attribute annotation.
* Disambiguate `path` dependencies using the parent package ID
Implements and closes#1789.
TODO:
- [x] Disambiguate `path` dependencies using parent package ID.
- [ ] Impl `Display` and `FromStr` for `PinnedId` to convert it to and
from hex for path source string in lock file.
- [ ] Address #1637 now to reduce this PR adding even more noise in the
lock file `dependencies` lists.
- [ ] Refactor `fetch_deps` slightly to better accomodate new `Root`
source variant.
- [ ] Update lock files of all examples and tests in repository.
* Swap `ToString` impls for `Display`. Add `PinnedId` impls.
Also removes the `lock::source_from_str/source_to_string` impls in
favour of implementing `Display` and `FromStr` for `SourcePinned`.
* Only disambiguate pkg lock dependencies if the name requires it
Closes#1637.
* Update new add_deps function for changes applied to pin_pkg
* Fix path dependency disambiguation using a path root rather than parent
Improves path dependency disambiguation by using the ID of the package
that is the root of the subgraph of path dependencies.
* Update `examples` forc lock files for path disambiguation changes
* Update E2E test forc lock files for path disambiguation changes
* Update stdlib test lock files for path dependency disambiguation changes
* Update new lock files introduced since previous rebase
* Make build-all-examples also check formatting.
* Install forc-fmt in CI.
* fmt examples
* Remove duplicate CI steps.
* Revert "Remove duplicate CI steps."
This reverts commit 8cbaaf1c43.
* Install forc-fmt prior to all build-all-examples.
* Updated counter, hello_world, and wallet_smart_contract
* subcurrency
* fizzbuzz
* changes to the docs
* addressing comments
* revert a small change to the Sway book... to be made in a separate PR
* Initial commit
* Initial commit
* initial commit
* intial commit
* update manifest to use git core dependency
* add README
* Add README
* Fix link to forc (#1)
* Fix link to forc (#1)
* Add basic build CI workflow (#2)
* Add basic build CI workflow.
* Remove installation and use of fuel-core.
* Implement Modulo (#3)
Added "modulo" function so the % operator works
Very simple implementation to all the other functions just wrapping the mod opcode
* .gitattributes to highlight .sw syntax as rust (#3)
* .gitattributes to highlight .sw syntax as rust (#5)
* Add Result type (#6)
* Add Result type.
* Fix syntax.
* Add basic build CI workflow. (#8)
* Add in rsh and lsh operations (#6)
* Update ops.sw
* Weird spacing thing
* ec-recover (#5)
* Add ecr lib
* Add todo comment
* Add recover_pubkey and refactor ecr
* Fixup
* Update comments
* Add comments to ec-recover asm block
* Modify asm
* Clean up asm
* Fix B512 field assignment
* Fix ordering of lib deps
* Remove ec_recover, to be added in separate PR
* Clean up comments
* Adding the missing `ec_recover`functionality (#18)
* Add todo comment
* Add working ec_recover implementation
* Format manifest file. (#10)
* Adding the `mint` and `burn` token operations. (#26)
* Add token lib
* Add todo comment
* Rename token_id to asset_id
* Rename token_id to asset_id
* Rename token_id to asset_id
* Fix register names in asm block
* Fixup
* Refactor ugly while loop
* Fixup
* Remove ecr from branch
* Fix review issues
* Modify type definition to silence warning re losing precision via type-cast
* Fix asm block registers
* Add only the mint function
* Ad burn to token lib
* "fix toml file"
* Split `eq` out of `Ord` and put it in `Eq` (#9)
* Moved eq into its own trait (Eq)
Moved eq into it's own trait (Eq) and then added all the implementations for u64, u32, u16, u8, and b256
* Forgot to delete u16's old Eq implementation
* Move le to a test implementation
* Fixed ge, le, and neq to not use eq and instead use inline assembly
* Update ops.sw
* Formatting changes
* Adding the force_transfer function to the token lib. (#27)
* Add force_transfer function to token lib
* Add import of ContractID type
* Implement the Eq trait for Address (#25)
* Impl Ord for Address
* Fix todo comment
* Fix toml formatting
* Add comment to use meq
* Impl Eq for Address
* Fix formatting
* Remove todo
* Add more methods to Result. (#16)
* Add more methods to Result.
* Don't use catch all.
* Use catch up, but fix typo.
* Fix return type.
* Compile workarounds.
* fmt
* Remove todo comments.
* fmt
* Make Result public.
* Add Option type & is_some/is_none methods (#31)
* Feat:Add Option type & is_some/is_none methods
* Doc:Improve module-level docs
* Fix:Add generic type T to match
* Simplify the B512 (and therefore ECR) code. (#33)
* Simplify the B512 (and therefore ECR) code.
Instead of 2 b256 fields in a struct we can use a 2 element array
instead.
I found that both the assumptions about memory layout and all the
copying was producing brittle code, and simplifying the ASM blocks as
much as possible is a good thing.
* Do a `forc fmt`.
* Adding the transfer_to_output function to token library (#32)
* Add force_transfer function to token lib
* Add import of ContractID type
* Add transfer_to_output function to token lib
* Add imports and temp remove constants
* Add else clause to if branch
* Add better comment
* Add final else clause to if branch
* Add semicolons to if-else
* style: add a comment and remove trailing semicolon from if statement in return position
* fix: make some comments internal
* fix: re-enable constants
* fix: change OUTPUT_LENGTH_LOCATION from 48 to 56
* fix: clean up assembly and incorporate PR review feedback
* docs: fix comments to reflect change to OUTPUT_LENGTH_LOCATION
* fix: remove redundent local variable assignment
* refactor: split asm blocks to avoid a second usage of the xos opcode
* style: forc fmt
* fix:change offset to 40 for getting amount
* Implementing an initial version of a msg_sender function (#30)
* Add module level docstring description
* Rearrange lib.sw order
* Use result type and add Sender type
* Improve function documentation
* refactor: improve clarity by removing the ! operator
* refactor: pass in constants to asm blocks
* fix: remove redundent `dep address;` from lib.sw
* fix: switch consts to enum
* refactor: revert to using constants for now but added TODO
* Minimal viable test harness for the stdlib (#37)
* config:update gitignore to ignore all tagket dirs
* feat:add working demo of test harness
* fix:add modules
* Add new demo_script_test project
* build:update dep versions in manifest files
* fix:update code in mod and main
* fix:change author email
* fixup
* fix:use local path to ttest current stdlib
* test:remove dummy test
* cleanup:remove dummy tests in prep for merge
* style:cargo fmt
* Porting token ops tests to the new stdlib test harness (#42)
* test:add token-ops tests
* test:update structure
* test:add more test
* test:adds more comments to failing tests
* test:remove failing tests from PR
* style:cargo fmt
* stle:forc fmt
* style:fix formatting I missed
* test:cleanup and remove logs
* bugfix: remove second register from gm opcode (#46)
* fix:remove second register from gm opcode
* docs:add link to gm opcode spec
* Add out directory to gitignore. (#50)
* Implement Square Root into the Standard Library (#49)
* Implement Square Root Function for uint types
* Update math.sw
* Update lib.sw
* Update math.sw
* Update math.sw
* Update math.sw
* Add Square Trait to uint
* Fix fmt
* Update math.sw
* Update math.sw
* Bump test dependencies. (#52)
* Bump test dependencies.
* Remove patch version.
* Use `t` instead of `T` for `Result` matches. (#53)
* Use t instead of T for Result matches.
* Update option.sw
* change author to authors in Forc.toml (#11)
* change author to authors in Forc.toml files (#56)
* switch from matches to if lets for enum destructuring (#62)
* switch from matches to if lets
* fmt
* Temporarily remove the Option and Result implementations (#63)
* fix:temp removal of result & option implementations
* fix:remove option & result from lib.sw
* fix:remove import of Result & change return type of msg_sender temporarily
* Fix return types of context::contract_id & context::msg_asset_id (#59)
* style:fix weird forc fmt issue
* fix:correct the return type for context module funcs
* test:add contract and json abi file
* test:add module to harness
* build:add manifest file
* test:add tests for context module
* style:forc fmt
* style:cargo fmt
* style:formatting
* fix:remove context test_project, coming in follow-up PR
* style:forc fmt
* Update token ops tests (#64)
* cleanup:remove duplicate abi
* build:update deps for sdk
* build:bump fuels-rs versions
* fix:remove salt field
* test:update to use newest syntax
* style:cargo fmt
* Adding a registers.sw module (#61)
* feat:add bare module registers
* feat:add registers.sw to expose16 reserved registers
* test:add new test project "registers"
* build:update forc manifest file
* test:add contract and abi.json
* test:add test file and empty tests
* test:temp disable ret & retl, add simple tests
* test:enable ret & retl again
* build:update manifest authors field
* build:remove redundant abi file
* fix:remove unneeded zero and one functions
* fix:remove zero and one funcs from abi and contract
* test:remove tests for zero and one & updates paths to abi file
* test:fix expected values and function calls
* style:forc fmt
* fix: add dep registers to context.sw
* style: forc fmt
* build:bump sdk version and add fuels-signers as a dep
* update tests to use new syntax
* style:cargo fmt & forc fmt
* Avoid implicit cast warning (#65)
* avoid implicit cast warning
* minor variable naming change
Co-authored-by: Mohammad <mohammad@Mohammads-MacBook-Pro.local>
* Fix test formatting. (#51)
* Ignore Forc lockfile (#69)
* Use new contract call syntax. (#70)
* Use new contract call syntax.
* Missed one
* Make core branch explicit (#71)
* Make core branch explicit
* Update Forc.toml
* fix:correct inline docs for registers.sw (#72)
* Fix some `path`s in the test project dependencies (#73)
The `path`s of dependencies should be point to the directory containing
the dependency's `Forc.toml` (not the `src`). This commit fixes the
`Forc.toml`s of the test projects to account for this.
There was also a spuriuos Forc.toml at `tests/Forc.toml` which has been
removed.
* Rename param in the ContractId::into() implementation (#76)
* fix:rename param
* docs:update comment and link tracking issue
* fixup
* Prefer `https` over `http` for forc git dependency URLs (#77)
This helps to resolve some dependency double-ups pending a proper
solution fix in `forc`.
See https://github.com/FuelLabs/sway/issues/931 and https://github.com/FuelLabs/fuels-rs/pull/150#discussion_r825312119
* Add `out` and `Forc.lock` to gitignore (#13)
* Bump SDK version (#78)
* build:bump SDK and dep versions
* test;update tests to use new SDK version syntax
* style:cargo fmt
* build:add fule-vm as a dep
* test:add an is_within_range() function to avoid hardcoded vals
* style:cargo fmt
* Rename ETH_ID to NATIVE_ASSET_ID (#79)
* b256 -> contractId params for context functions which get balance from a contract (this or other) (#81)
* hotfix:complete param type changes (#82)
* Implement the `EQ` trait for `ContractId` (#83)
* feat:impl eq for ContractId
* test:add test project for contractId eq implementation
* test:wip on sscript test
* test:add script call draft
* test: finish script test
* test:finish test for contractId eq impl
* fix: remove comment
* style: cargo fmt
* build:remove core as unneeded dep
* Change `[project]` name from `lib-std` to `std` (#80)
See https://github.com/FuelLabs/sway/issues/977 for motivation.
* bump sdk to 0.7. Use test-helpers to cut down on boilerplate (#84)
* Cleanup stdlib tests (#85)
* cleanup: remove compiler warnings
* style: cargo fmt
* Adding a call_frames module (#66)
* test:add new test project call_frames
* test:add bare call_frames module
* feat:add initial call_frames.sw module
* feat:add new call frame access constants
* feat:add call_frames.sw and refactor context mod
* fix:reorder lib.sw
* style:cleanup comments'
* style:forc fmt
* refactor:reorganize functions by module and expose under context namespace
* cleanup:remove unneeded files from test project
* test:add initial draft test
* test:add first test
* temp:remove use of constants
* test:setup test project and artifact for call_frames
* test:outline primary tests
* test:fix test assertions
* cleanup:remove helper functions from call_frames until they can be tested
* style:cargo fmt & forc fmt
* test:cleanup forc tomls
* test:use new contract call syntax
* fix:update return types for call_frames functions
* test:update to SDK v 0.6
* test:update tests
* style: cargo fmt
* fix:rename var to satisfy compiler
* style: forc fmt
* cleanup: remove unused CONSTs until needed
* build: remove core as a dep
* Disable default features from fuel-core (#86)
* Implement Eq for bool (#14)
* Re-add Option and Result. (#68)
* Re-add Option and Result.
* Re-add to auth.
* fmt
* Fix option and result, and add tests.
* Remove redundant gitignores.
* Fix tests.
* Fix to actually compile.
* Fix function naming.
* Fix test.
* Add missing semicolon.
* move option dep up
* Add `Result.unwrap()` (#90)
* Refactor panic into separate library.
* Update tests to use new panic.
* Implement unwrap.
* Add test.
* Add Option.unwrap() (#91)
* Bump fuels-rs to v0.8 (#92)
* Refactor the context module & port tests to SDK (#89)
* test:add new context test project
* test:add context module to harness
* test:add context testing contract and abi
* test:add context_testing_abi
* test:add the first tests
* test:fix contract path
* refactor:context.sw balance functions now use a common balance func
* test:add context_caller_contract to test_artifacts
* temp:ignore failing tests
* reorg:remove tests which belong elsewhere
* build:fix manifest fields
* test:add get_global_gas to context contract
* test:update context_testing_abi
* test:update context_caller abi & contract
* test:add and fix tests for context
* fix:fix types in context module
* build:cleanup/fix forc toml files
* test:cleanup types & contract calls
* build:update deps in cargo toml
* fix:update types in token_ops
* test:update to new sdk version
* test:update import paths to use .bin files
* test:update more tests to use new build path and comparison values
* test:cleanup
* fix:update contract call in caller contract
* test:fix test call to use correct contract
* build: bump SDK to 7
* style: forc fmt
* style: forc fmt
* test: refactor & bump to SDK 7
* style: cargo fmt
* test: update SDK usage to use latest features
* test:work on fixing tests
* improvement: rename contract_id to target
* fix: rename balance() and refactor imports
* style: use multi import syntax
* test: refactor test helper funcs
* test: fix function call names
* refactor: rename functions for clarity
* test: remove use of helper funcs bc/ContractNotFound
* style: cargo fmt
* fix: add gas param to all inter-contract calls
* test: refactor helper to share provider
* fix: update abis and contracts
* test: fix balance test
* fix: remove minting from contract functions
* test: add minting step to tests
* test: cleanup tests
* test: get all tests passing
* test:remove failing duplicate test
* style: cargo fmt && forc fmt
* build: remove core as a dep
* refactor: balance reg & balance_of funcs
* fix: update function names in contracts
* style: forc fmt
* test: fix tests by removing call_params
* style: cargo fmt
* cleanup: remove all compiler warnings
* Walk git dependency repo to discover nested forc dependencies
Closes#952.
This should be complete for the most part, though depends on implementing #977 first.
* Remove implied pkg from names of pkg discovery fns
* Update `Cargo.lock` for the addition of `walkdir`
`walkdir` is used to traverse the git repository when searching for
dependency packages.
* Change `std`'s `core` dep to use the local path
Yet to test whether `forc` can handle `path` dependencies within
dependencies. In theory I these should work provided that the `path` is
relative and points to a location within the same git repository. If
this *does* work, the behaviour should be discussed, documented and
enforced by `forc`.
* Update examples `std` dependency declarations to use local `path`
* Update all tests to depend on `std` via local `path`
This should assist in ensuring that all tests must always pass for any
change to `sway`, `lib-core`, `lib-std` or `forc`.
* Build sway-lib-core and sway-lib-std under unique CI jobs
* Add successful `sway-lib-core` and `sway-lib-std` reqs for publish
* Add tx module. (#93)
* Add tx module.
* Add functions.
* Clean up.
* Add skeleton test artifact project.
* Use hard-coded constants since compiler can't handle consts.
* Fill in skeleton.
* Make untested get typed script data non-pub.
* Add output functions.
* Comment out unreachable.
* Improve name.
* Add remaining functions.
* Fix name.
* Register tests to harness.
* Add tests.
* Fix script start offset test.
* Fix script start offset get.
* Fix test with todo.
* Add non-working test for input coin owner.
* Return wallet.
* Fix test.
* Update transfer to output (#94)
* fixing transfer_to_output
* Update transfer_to_output
* Improving a comment
* fmt
* Auth method 3 (#54)
* Add changes from prior work
* Remove import of ops
* Cleanup and format
* Rename functions to match opcode naming
* Re-order lib.sw
* Fix types to use ContractId
* Refactor and cleanup
* Reorder lib.sw
* Clean up comments and types
* FIx lib deps ordering
* cleanup
* congig:update gitignore
* Commit stashed changes with get_coin_owner WIP
* Fix:cleanup merge conflict resolution mistake
* Clean up a bit and use Result.
* General cleanup.
* Improve comment.
* Fix a bunch of type errors.
* Add missed assert.
* Fix order to make compile.
* Refactor.
* fix
* Fix build errors.
* Update offsets for 255 max inputs.
* Remove warnings.
* Improve error name.
* Fix some asm.
* Fix more asm
* space
* Fix comment
* Fix offsets.
* Refactor to use new tx module.
* test: add auth test project
* test: register auth tests
* test: add tests to mod.rs
* test: add auth testing abi & contract
* test: add auth caller contract & script
* test: fix enum variant name
* test: fix import of result
* test: refactor types to workaround MissingData error from SDK
* test: fix number of args passed
* test: ignore script test
* style: forc fmt
* style: cargo fmt
* test: work on script test
* Remove redundant assert.
* Clean up tests, not working yet.
* Fix test for some reason.
* Fix test.
Co-authored-by: Nick Furfaro <nfurfaro33@gmail.com>
* Update path to assert (#97)
* test: update path to assert
* Delete build.sh
Added by accident.
* test: remove redundant test (#99)
* Update examples and tests for chain::assert -> assert::assert
* Update newly merged test for chain::assert -> assert::assert
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Alex Hansen <alex@alex-hansen.com>
Co-authored-by: ControlCplusControlV <44706811+ControlCplusControlV@users.noreply.github.com>
Co-authored-by: wolflo <33909953+wolflo@users.noreply.github.com>
Co-authored-by: Nick Furfaro <nfurfaro33@gmail.com>
Co-authored-by: Toby Hutton <toby@grusly.com>
Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com>
Co-authored-by: Mohammad <mohammad@Mohammads-MacBook-Pro.local>
Co-authored-by: Simon Roberts <46566889+simonr0204@users.noreply.github.com>
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
* Add proper support for git reference kinds (`branch`, `tag`, `rev`)
Works toward resolving #1019, however tests and examples still need to
be updated.
Previously, we initialised the temporary git repository with a `clone`
operation. By default, this only fetches a subset of git references,
meaning that using references other than those provided by default with
`clone` failed to resolve.
Inspired by cargo, this commit updates the behaviour to instead first
initialise the repository, then attempt to fetch only those references
that are relevant to the user specified git reference.
In order to construct an accurate set of `refspecs` and fetch only the
relevant commits, its useful to retain knowledge about the *kind* of git
reference. This introduces a new `GitReference` type and updates the git
source lock file serialization to account for this.
* Update example `Forc.lock` files for git reference changes
* Update E2E test `Forc.lock` files for git reference changes
* Validate the commit hash while parsing `SourceGitPinned` from str