-
Notifications
You must be signed in to change notification settings - Fork 184
abi: import files from latest geth release #815
Conversation
… into map[string]interface{} (#18440)
Allow the --abi flag to be given - to indicate that it should read the ABI information from standard input. It expects to read the solc output with the --combined-json flag providing bin, abi, userdoc, devdoc, and metadata, and works very similarly to the internal invocation of solc, except it allows external invocation of solc. This facilitates integration with more complex solc invocations, such as invocations that require path remapping or --allow-paths tweaks. Simple usage example: solc --combined-json bin,abi,userdoc,devdoc,metadata *.sol | abigen --abi -
plus fix typo: binruntimesFlag -> binruntimeFlag, RCode -> RuntimeCode
also, not imported unuseful folders: cmd/geth, cmd/swarm
They are translated as [24]byte * Add Java template version * accounts/abi/bind: fix merge issue * Fix CI
argument type and name were reversed
accounts/abi, cmd/abigen: support tuple * accounts/abi/bind, cmd/abigen: add objc back * accounts/abi/bind: use byte[24] as function indicator, resolve struct slice or array, remove sort logic accounts: fix issues in abi accounts/abi: address comment
* accounts, abigen: link dependent libs in deploy * abigen: add java generation * bind: Fix unit tests * abigen: add unit test * Fix CI
* cmd, common: refactor abigen command line interface * cmd/abigen: address comment
from "all: on-chain oracle checkpoint syncing (#19543)"
The abi package already supports function overload by adding a suffix to the overloaded function name, but it uses the function name with suffix to calculate signature(both for the event and method). This PR fixes it by adding a new field named RawName, which can be used to calcuate all signatures but use Name to distinguish different overloaded function.
* accounts/abi: fix various issues The fixed issues include: (1) If there is no return in a call function, unpack should return nil error (2) For some functions which have struct array as parameter, it will also be detected and generate the struct definition (3) For event, if it has non-indexed parameter, the parameter name will also be assigned if empty. Also the internal struct will be detected and generate struct defition if not exist. (4) Fix annotation generation in event function * accounts/abi: add new abi field internalType * accounts: address comments and add tests * accounts/abi: replace strings.ReplaceAll with strings.Replace
…20269) * fix parseTopics() and add tests
* accounts/abi/bind: use store function to remove code duplication * accounts/abi/bind: removed unused type defs * accounts/abi/bind: error on tuples in topics * Cosmetic changes to restart travis build
Currently the java generator generates invalid input on pure/view functions that have no return type. e.g. `function f(uint u) view public {}` This is not a problem in practice as people rarely ever write functions like this.
* UnpackRevert function is came from geth PR (seperate consensus error and evm internal error #20830) * abi.go copyright is updated due to import statement modification
* move topics.go and topics_test.go to abi package * add TestWaitDeployedCornerCases test case
also modify copyright of doc.go
* fix typos package backends refactoring * bring NewSimulatedBackendWithDatabase and refactor NewSimulatedBackendWithGasPrice and NewSimulatedBackend function * bring nullSubscription and refactor filterBackend related functions * change variable name from statedb to stateDB * remove unused parameters
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.
I compared this abi pkg code with geth reference code with @yoomee1313.
There is some difference. But @yoomee1313 will list up the PRs which is not applied in this PR. They caused some differences.
And I reviewed extra code also. I think it's ok.
However, the new fallback test code doesn't work.
@yoomee1313 Please check the test.
I think there may be some differences in the transaction call routine.
* bring gasCap code to simulatedBackend EstimateGas (from geth PR #21043) * take into account gas price during gas estimation (from geth PR #20189) * make bind.logger to be public so it can be used at backends package too
* initialize gotEvent after receive call * remove assembly call in solidity code, instead use msg.data
3446389
to
c77bed7
Compare
Refactor NewFallback TC. Co-authored-by: Ethan (Kyungup Kim) <[email protected]>
@yoomee1313 In content, all geth PR link is broken. Could you link them with their PRs? |
@yoomee1313 Could you please share the progress of this PR? Are there any other things left to merge this change? |
Forgive me for being late. I was delayed trying to find out about the situations below. In conclusion, this PR supports |
PTAL @aidan-kwon. Let's merge~!!! |
Proposed changes
This PR updates abi package and abigen. It applies all abi related changes up to v1.9.21.
abi, bind package is identical with geth v1.9.21. However, backends package is not exactly identical because some geth changes are not applied yet. I didn’t applied them or applied part of them because those changes are huge and not only included at abi package. Also, I removed unnecessary codes such as vyper, clef, etc. You can refer the commit msgs which geth PR is applied.
Below PRs are the PR lists that i didn’t included. If needed, please refer them.
fix NewFallback TC
NewFallback TC contains a bug. Fixed TC and fixed NewFallback contract to below.
Related Geth PR ethereum/go-ethereum#22053
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...