Skip to content
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

Bump dependencies & Remove unnecessary dependencies. #523

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.gradle.internal.os.OperatingSystem

buildscript {
ext.okhttpclientVersion = '4.10.0'
ext.okhttpclientVersion = '4.11.0'
}

plugins {
Expand Down Expand Up @@ -72,17 +72,15 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp-sse:${okhttpclientVersion}"
implementation 'com.moandjiezana.toml:toml4j:0.7.2'
// use the android version because we don't want java 8 stuff
implementation 'com.google.guava:guava:26.0-android'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'commons-io:commons-io:2.11.0'
// TODO: Do we really need to introduce guava?
Copy link
Contributor

Choose a reason for hiding this comment

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

if you're willing to try removal as part of this pr, and see how much turns red, it brings in com.google.common.base which is ref'd everywhere in app code for Preconditions and Objects convenience helpers, doesn't look like it's required though as a transitive dep from other dependencies.

implementation 'com.google.guava:guava:32.1.2-android'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'net.i2p.crypto:eddsa:0.3.0'
implementation 'org.threeten:threetenbp:1.6.0'

testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'org.mockito:mockito-core:5.5.0'
testImplementation "com.squareup.okhttp3:mockwebserver:${okhttpclientVersion}"
testImplementation 'junit:junit:4.13.2'
testImplementation 'javax.xml.bind:jaxb-api:2.3.1'
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '4.12.1'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.10.0'
}

tasks.named('test') { task ->
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/stellar/sdk/Predicate.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.base.Objects;
import com.google.common.collect.Lists;
import java.math.BigInteger;
import java.time.Instant;
import java.util.List;
import org.stellar.sdk.xdr.ClaimPredicate;
import org.stellar.sdk.xdr.ClaimPredicateType;
Expand All @@ -11,7 +12,6 @@
import org.stellar.sdk.xdr.TimePoint;
import org.stellar.sdk.xdr.Uint64;
import org.stellar.sdk.xdr.XdrUnsignedHyperInteger;
import org.threeten.bp.Instant;

public abstract class Predicate {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import com.google.common.collect.Lists;
import com.google.gson.*;
import java.lang.reflect.Type;
import java.time.Instant;
import java.util.List;
import org.stellar.sdk.Predicate;
import org.stellar.sdk.xdr.Duration;
import org.stellar.sdk.xdr.TimePoint;
import org.stellar.sdk.xdr.Uint64;
import org.stellar.sdk.xdr.XdrUnsignedHyperInteger;
import org.threeten.bp.Instant;

public class PredicateDeserializer implements JsonDeserializer<Predicate> {
@Override
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/stellar/sdk/PredicateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import static org.junit.Assert.assertEquals;

import java.math.BigInteger;
import java.time.Instant;
import org.junit.Test;
import org.threeten.bp.Instant;

public class PredicateTest {
@Test
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/stellar/sdk/StrKeyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
public class StrKeyTest {
@Test
public void testDecodeEncode() throws IOException, FormatException {

String seed = "SDJHRQF4GCMIIKAAAQ6IHY42X73FQFLHUULAPSKKD4DFDM7UXWWCRHBE";
byte[] secret = StrKey.decodeCheck(StrKey.VersionByte.SEED, seed.toCharArray());
char[] encoded = StrKey.encodeCheck(StrKey.VersionByte.SEED, secret);
Expand Down
77 changes: 11 additions & 66 deletions src/test/java/org/stellar/sdk/TransactionBuilderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,8 @@ public void testBuilderSuccessTestnet() throws Exception {
assertEquals(expectedExt, transaction.toEnvelopeXdr().getV1().getTx().getExt());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -99,13 +94,8 @@ public void testBuilderMemoText() throws Exception {
transaction.sign(source);

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -139,13 +129,8 @@ public void testBuilderTimeBounds() throws FormatException, IOException {

// Convert transaction to binary XDR and back again to make sure timebounds are correctly
// de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());

assertEquals(
decodedTransaction
Expand Down Expand Up @@ -199,13 +184,8 @@ public void testBuilderBaseFee() throws Exception {
transaction.sign(source);

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -250,13 +230,8 @@ public void testBuilderTimebounds() throws IOException {
assertEquals(1337, transaction.getTimeBounds().getMaxTime().intValue());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -313,13 +288,8 @@ public void testBuilderTimeout() throws IOException {

// Convert transaction to binary XDR and back again to make sure timebounds are correctly
// de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -351,13 +321,8 @@ public void testBuilderSetsLedgerBounds() throws IOException {
assertEquals(1, transaction.getPreconditions().getLedgerBounds().getMinLedger());
assertEquals(2, transaction.getPreconditions().getLedgerBounds().getMaxLedger());

XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -400,13 +365,8 @@ public void testBuilderSetsMinSeqNum() throws IOException {
assertEquals(Long.valueOf(5), transaction.getPreconditions().getMinSeqNumber());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -442,13 +402,8 @@ public void testBuilderSetsMinSeqAge() throws IOException {
assertEquals(5, transaction.getPreconditions().getMinSeqAge().intValue());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -484,13 +439,8 @@ public void testBuilderSetsMinSeqLedgerGap() throws IOException {
assertEquals(5, transaction.getPreconditions().getMinSeqLedgerGap());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down Expand Up @@ -551,13 +501,8 @@ public void testBuilderExtraSigners() throws IOException {
.getPayload());

// Convert transaction to binary XDR and back again to make sure correctly xdr de/serialized.
XdrDataInputStream is =
new XdrDataInputStream(
new ByteArrayInputStream(
javax.xml.bind.DatatypeConverter.parseBase64Binary(
transaction.toEnvelopeXdrBase64())));
org.stellar.sdk.xdr.TransactionEnvelope decodedTransaction =
org.stellar.sdk.xdr.TransactionEnvelope.decode(is);
org.stellar.sdk.xdr.TransactionEnvelope.fromXdrBase64(transaction.toEnvelopeXdrBase64());
Transaction transaction2 =
(Transaction)
Transaction.fromEnvelopeXdr(
Expand Down
Loading