-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make getABI_* calls in wrapper should be static #2079
Merged
Merged
Changes from all commits
Commits
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 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 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 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,10 @@ | ||
pragma solidity >= 0.8.7; | ||
|
||
contract AbiFuncs { | ||
|
||
|
||
function hi(uint256 x) public { | ||
|
||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
codegen/src/test/resources/solidity/abifuncs/build/AbiFuncs.abi
This file contains 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 @@ | ||
[{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"hi","outputs":[],"stateMutability":"nonpayable","type":"function"}] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same lets use any existing solidity and compile .abi and .bin files |
1 change: 1 addition & 0 deletions
1
codegen/src/test/resources/solidity/abifuncs/build/AbiFuncs.bin
This file contains 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 @@ | ||
608060405234801561000f575f80fd5b5060d38061001c5f395ff3fe6080604052348015600e575f80fd5b50600436106026575f3560e01c80634cf1b41d14602a575b5f80fd5b60406004803603810190603c91906077565b6042565b005b50565b5f80fd5b5f819050919050565b6059816049565b81146062575f80fd5b50565b5f813590506071816052565b92915050565b5f6020828403121560895760886045565b5b5f6094848285016065565b9150509291505056fea2646970667358221220e788c40f4c54add124e8c2662f9bc92e122a1ea722846a0a855e1ffb68cbdac564736f6c63430008140033 |
91 changes: 91 additions & 0 deletions
91
codegen/src/test/resources/solidity/abifuncs/build/java/AbiFuncs.java
This file contains 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,91 @@ | ||
package org.web3j.unittests.java; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import org.web3j.abi.TypeReference; | ||
import org.web3j.abi.datatypes.Function; | ||
import org.web3j.abi.datatypes.Type; | ||
import org.web3j.crypto.Credentials; | ||
import org.web3j.protocol.Web3j; | ||
import org.web3j.protocol.core.RemoteFunctionCall; | ||
import org.web3j.protocol.core.methods.response.TransactionReceipt; | ||
import org.web3j.tx.Contract; | ||
import org.web3j.tx.TransactionManager; | ||
import org.web3j.tx.gas.ContractGasProvider; | ||
|
||
/** | ||
* <p>Auto generated code. | ||
* <p><strong>Do not modify!</strong> | ||
* <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>, | ||
* or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the | ||
* <a href="https://github.com/web3j/web3j/tree/main/codegen">codegen module</a> to update. | ||
* | ||
* <p>Generated with web3j version none. | ||
*/ | ||
@SuppressWarnings("rawtypes") | ||
public class AbiFuncs extends Contract { | ||
public static final String BINARY = "Bin file was not provided"; | ||
|
||
public static final String FUNC_HI = "hi"; | ||
|
||
@Deprecated | ||
protected AbiFuncs(String contractAddress, Web3j web3j, Credentials credentials, | ||
BigInteger gasPrice, BigInteger gasLimit) { | ||
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit); | ||
} | ||
|
||
protected AbiFuncs(String contractAddress, Web3j web3j, Credentials credentials, | ||
ContractGasProvider contractGasProvider) { | ||
super(BINARY, contractAddress, web3j, credentials, contractGasProvider); | ||
} | ||
|
||
@Deprecated | ||
protected AbiFuncs(String contractAddress, Web3j web3j, TransactionManager transactionManager, | ||
BigInteger gasPrice, BigInteger gasLimit) { | ||
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit); | ||
} | ||
|
||
protected AbiFuncs(String contractAddress, Web3j web3j, TransactionManager transactionManager, | ||
ContractGasProvider contractGasProvider) { | ||
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider); | ||
} | ||
|
||
public RemoteFunctionCall<TransactionReceipt> hi(BigInteger x) { | ||
final Function function = new Function( | ||
FUNC_HI, | ||
Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(x)), | ||
Collections.<TypeReference<?>>emptyList()); | ||
return executeRemoteCallTransaction(function); | ||
} | ||
|
||
public static String getABI_hi(BigInteger x) { | ||
final Function function = new Function( | ||
FUNC_HI, | ||
Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint256(x)), | ||
Collections.<TypeReference<?>>emptyList()); | ||
return org.web3j.abi.FunctionEncoder.encode(function); | ||
} | ||
|
||
@Deprecated | ||
public static AbiFuncs load(String contractAddress, Web3j web3j, Credentials credentials, | ||
BigInteger gasPrice, BigInteger gasLimit) { | ||
return new AbiFuncs(contractAddress, web3j, credentials, gasPrice, gasLimit); | ||
} | ||
|
||
@Deprecated | ||
public static AbiFuncs load(String contractAddress, Web3j web3j, | ||
TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) { | ||
return new AbiFuncs(contractAddress, web3j, transactionManager, gasPrice, gasLimit); | ||
} | ||
|
||
public static AbiFuncs load(String contractAddress, Web3j web3j, Credentials credentials, | ||
ContractGasProvider contractGasProvider) { | ||
return new AbiFuncs(contractAddress, web3j, credentials, contractGasProvider); | ||
} | ||
|
||
public static AbiFuncs load(String contractAddress, Web3j web3j, | ||
TransactionManager transactionManager, ContractGasProvider contractGasProvider) { | ||
return new AbiFuncs(contractAddress, web3j, transactionManager, contractGasProvider); | ||
} | ||
} |
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.
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.
This seems like an empty solidity file, can't we reuse any pre-existing .sol file for the test?
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 also want to test java file output matches, if I use any existing file, I will have to modify those java files to add getABI* calls, but that will actually invalidate the test case with abiFunc=false
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.
Okay got it