- Notifications
You must be signed in to change notification settings - Fork43
[1.2.0]#14
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
[1.2.0]#14
Changes fromall commits
Commits
Show all changes
8 commits Select commitHold shift + click to select a range
be775cf Add support for ERC-721 (NFT) Tokens
7ce4a07 Fix formatting
e8cd38d fix formatting again
478faf9 Add tests for RC-721 Tokens
4bb51f6 Merge pull request #13 from NGuggs/master
GoodforGod6070078 [1.1.1]
GoodforGod3a69c65 [1.1.1]
GoodforGod6f359b5 [1.2.0]
GoodforGodFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletionbuild.gradle
This file contains hidden or 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
2 changes: 1 addition & 1 deletiongradle.properties
This file contains hidden or 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 |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| groupId=com.github.goodforgod | ||
| artifactId=java-etherscan-api | ||
| artifactVersion=1.2.0 | ||
| buildNumber=1 | ||
20 changes: 19 additions & 1 deletionsrc/main/java/io/api/etherscan/core/IAccountApi.java
This file contains hidden or 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
26 changes: 26 additions & 0 deletionssrc/main/java/io/api/etherscan/core/impl/AccountApiProvider.java
This file contains hidden or 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
2 changes: 1 addition & 1 deletionsrc/main/java/io/api/etherscan/manager/impl/QueueManager.java
This file contains hidden or 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
5 changes: 4 additions & 1 deletionsrc/test/java/io/api/ApiRunner.java
This file contains hidden or 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
80 changes: 80 additions & 0 deletionssrc/test/java/io/api/etherscan/account/AccountTxRc721TokenTest.java
This file contains hidden or 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,80 @@ | ||
| package io.api.etherscan.account; | ||
| import io.api.ApiRunner; | ||
| import io.api.etherscan.error.InvalidAddressException; | ||
| import io.api.etherscan.model.TxToken; | ||
| import org.junit.Test; | ||
| import java.util.List; | ||
| /** | ||
| * @author NGuggs | ||
| * @since 11.28.2021 | ||
| */ | ||
| public class AccountTxRc721TokenTest extends ApiRunner { | ||
| @Test | ||
| public void correct() { | ||
| List<TxToken> txs = getApi().account().txsNftToken("0x1a1ebe0d86f72884c3fd484ae1e796e08f8ffa67"); | ||
| assertNotNull(txs); | ||
| assertEquals(16, txs.size()); | ||
| assertTxs(txs); | ||
| assertNotEquals(0, txs.get(0).getGasPrice()); | ||
| assertNotEquals(-1, txs.get(0).getNonce()); | ||
| assertNotNull(txs.get(0).toString()); | ||
| assertNotEquals(txs.get(0).toString(), txs.get(1).toString()); | ||
| assertNotEquals(txs.get(0), txs.get(1)); | ||
| assertNotEquals(txs.get(0).hashCode(), txs.get(1).hashCode()); | ||
| assertEquals(txs.get(1), txs.get(1)); | ||
| assertEquals(txs.get(1).hashCode(), txs.get(1).hashCode()); | ||
| } | ||
| @Test | ||
| public void correctStartBlock() { | ||
| List<TxToken> txs = getApi().account().txsNftToken("0x1a1ebe0d86f72884c3fd484ae1e796e08f8ffa67", 4762071); | ||
| System.out.println(txs); | ||
| assertNotNull(txs); | ||
| assertEquals(5, txs.size()); | ||
| assertTxs(txs); | ||
| } | ||
| @Test | ||
| public void correctStartBlockEndBlock() { | ||
| List<TxToken> txs = getApi().account().txsNftToken("0x1a1ebe0d86f72884c3fd484ae1e796e08f8ffa67", 4761862, 4761934); | ||
| System.out.println(txs); | ||
| assertNotNull(txs); | ||
| assertEquals(11, txs.size()); | ||
| assertTxs(txs); | ||
| } | ||
| @Test(expected = InvalidAddressException.class) | ||
| public void invalidParamWithError() { | ||
| getApi().account().txsNftToken("0x6ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7"); | ||
| } | ||
| @Test | ||
| public void correctParamWithEmptyExpectedResult() { | ||
| List<TxToken> txs = getApi().account().txsNftToken("0x31ec53A8fBa6358d59B3C4476D82cc60A2B0FaD7"); | ||
| assertNotNull(txs); | ||
| assertTrue(txs.isEmpty()); | ||
| } | ||
| private void assertTxs(List<TxToken> txs) { | ||
| for (TxToken tx : txs) { | ||
| assertNotNull(tx.getBlockHash()); | ||
| assertNotNull(tx.getTokenName()); | ||
| assertNotNull(tx.getTokenSymbol()); | ||
| assertNotNull(tx.getFrom()); | ||
| assertNotNull(tx.getTo()); | ||
| assertNotNull(tx.getTimeStamp()); | ||
| assertNotNull(tx.getTokenDecimal()); | ||
| assertNotEquals(-1, (tx.getConfirmations())); | ||
| assertNotNull(tx.getGasUsed()); | ||
| assertNotEquals(-1, tx.getCumulativeGasUsed()); | ||
| assertNotEquals(-1, tx.getTransactionIndex()); | ||
| } | ||
| } | ||
| } |
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.