Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

#1023 #1024

Closed
wants to merge 13 commits into from
Closed

#1023 #1024

wants to merge 13 commits into from

Conversation

jeetabhi01
Copy link

Moved abibuiltins to builtinHandler directory.
resolves #1023

Copy link
Contributor

@piwonskp piwonskp left a comment

Choose a reason for hiding this comment

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

Tests are not passing

@jeetabhi01 jeetabhi01 requested a review from piwonskp April 8, 2023 08:51
Copy link
Contributor

@rodrigo-pino rodrigo-pino left a comment

Choose a reason for hiding this comment

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

You need to change as well the location where abiBuiltin is call. From src/transpiler.ts to src/passes/builtinHandler/index.ts

@jeetabhi01
Copy link
Author

You need to change as well the location where abiBuiltin is call. From src/transpiler.ts to src/passes/builtinHandler/index.ts

Could you please provide some more information on this one?

@rodrigo-pino
Copy link
Contributor

Hi @jeetabhi01 , sorry for not being clear. The way Warp work is that through several passes we handle different parts of the Solidity source code. One of those passes handle all builtins. When the pass that handled the abi builtin was made, it was as a standalone pass in src/passes/abiBuiltins.ts which get then instantiated in src/transpiler.ts in the applyPasses function. It should be instead define in src/passes/builtinHandler/ and be called instead by the code src/apsses/builtinHandler/index.ts

Copy link
Contributor

@rodrigo-pino rodrigo-pino left a comment

Choose a reason for hiding this comment

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

You can try to run tests locally as well, for faster debugging

src/passes/export.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to execute the ABIBuiltint pass in the map function

Copy link
Author

Choose a reason for hiding this comment

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

I have added the pass in the map function but yarn test:examples gave an error. @rodrigo-pino Please have a look in the changes.

Copy link
Author

Choose a reason for hiding this comment

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

Unexpected error during transpilation
Error: Unknown pass key: Abi in pass prerequisite of Events

Copy link
Contributor

Choose a reason for hiding this comment

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

Sometimes a pass requires that the AST to be already modified in certain way to guarantee it's correct execution. What's happening here is that there is a pass that required the abi pass, but since it is now inside the pass that handle all builtins it won't get detected.

You should find every pass that required the abi pass, change that requirement for the builtin pass instead.

src/passes/index.ts Outdated Show resolved Hide resolved
src/transpiler.ts Outdated Show resolved Hide resolved
src/transpiler.ts Outdated Show resolved Hide resolved
dependabot bot and others added 4 commits April 13, 2023 20:25
Bumps [webpack](https://github.com/webpack/webpack) from 5.73.0 to 5.76.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.73.0...v5.76.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* refactor

* case typo in import

* comments

* comments on replaceIndexAccessBytesConverter

* changes in utils

* lint

* changes in updateTypeStringBytesConverter

* `selectWarplibFunction` receive `typeNode` arguments
* test2

* discordbadgeee

* added discord and twitter badges

* created installation.md

* created contributing.md

* Rename contributing.md to contributingg.md

* Update readme.md

* Update and rename contributingg.md to contributing, devloping tips and testing.md

* Update readme.md

* Rename contributing, devloping tips and testing.md to Contributing and testing.md

* Rename Contributing and testing.md to Contributing.md

* Update readme.md

* Update readme.md

* Merge Contributing.md and CONTRIBUTING.md

* Contributing.md -> contributing.md

* Fix links

* Add note

* Update readmesssss

* Some fixes

* Changes

* Update contributing.md

Co-authored-by: Jorik Schellekens <joriksch@gmail.com>

* Update contributing.md

Co-authored-by: Jorik Schellekens <joriksch@gmail.com>

* Update contributing.md

* More changes"

* Behaviour

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* Behaviour II

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* remove rogue ñ

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* generic path

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* Minor update to contributing

* Update readme

* interpreted modes

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* Update contributing.md

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* Update contributing.md

Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>

* Update contributing.md

* fixes

* in a separate terminal

Co-authored-by: Carmen Irene Cabrera Rodríguez <49727740+cicr99@users.noreply.github.com>

---------

Co-authored-by: coeuskoalemoss <siddhi.kommuri@somaiya.edu>
Co-authored-by: Siddhi kommuri <84127077+coeuskoalemoss@users.noreply.github.com>
Co-authored-by: Jorik Schellekens <joriksch@gmail.com>
Co-authored-by: Piotr Piwoński <piwonskp@gmail.com>
Co-authored-by: Carmen Irene Cabrera Rodríguez <49727740+cicr99@users.noreply.github.com>
@rodrigo-pino
Copy link
Contributor

@jeetabhi01 do you need any more help, how it is going?

@jeetabhi01
Copy link
Author

@jeetabhi01 do you need any more help, how it is going?

Oh I am sorry for late reply,
Actually I am unable to find where the individual pass is implemented I tried debugging it but couldn't find it.

$ bin/warp transpile exampleContracts/ERC20.sol
Unexpected error during transpilation
Error: Unknown pass key: Abi in pass prerequisite of Events
    at /home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:45:23
    at Set.forEach (<anonymous>)
    at /home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:43:22
    at Array.forEach (<anonymous>)
    at parsePassOrder (/home/jeet_abhi01/Documents/Projects/warp/build/utils/cli.js:40:19)
    at applyPasses (/home/jeet_abhi01/Documents/Projects/warp/build/transpiler.js:86:52)
    at transpile (/home/jeet_abhi01/Documents/Projects/warp/build/transpiler.js:14:22)
    at Command.runTranspile (/home/jeet_abhi01/Documents/Projects/warp/build/cli.js:84:36)
    at Command.listener [as _actionHandler] (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:481:17)
    at /home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1236:65
    at Command._chainOrCall (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1152:12)
    at Command._parseCommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1236:27)
    at Command._dispatchSubcommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1058:25)
    at Command._parseCommand (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:1201:19)
    at Command.parse (/home/jeet_abhi01/Documents/Projects/warp/node_modules/commander/lib/command.js:890:10)
    at Object.<anonymous> (/home/jeet_abhi01/Documents/Projects/warp/build/index.js:4:15)
Transpilation failed

@jeetabhi01 jeetabhi01 closed this May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move abibuiltins to builtinHandler directory
4 participants