-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Neutron and Celestia providers
- Loading branch information
Showing
7 changed files
with
117 additions
and
4 deletions.
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
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
43 changes: 43 additions & 0 deletions
43
src/test/java/com/allmycoins/balance/CelestiaProviderTest.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,43 @@ | ||
package com.allmycoins.balance; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.List; | ||
import java.util.function.Supplier; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.allmycoins.PrivateConfig; | ||
import com.allmycoins.balance.cosmosjs.CosmosJsProvider; | ||
import com.allmycoins.balance.cosmosjs.CosmosJsProviders; | ||
import com.allmycoins.json.BalanceJson; | ||
|
||
final class CelestiaProviderTest { | ||
|
||
private static final Supplier<CosmosJsProvider> GET_PROVIDER = () -> CosmosJsProviders.CELESTIA_PROVIDER; | ||
|
||
@Test | ||
void testBalances() { | ||
PrivateConfig.loadConfigurationFromClassLoader(); | ||
|
||
CosmosJsProvider provider = GET_PROVIDER.get(); | ||
List<BalanceJson> balances = provider.balances(); | ||
assertEquals(1, balances.size()); | ||
|
||
BalanceJson balance = balances.get(0); | ||
|
||
assertEquals("TIA", balance.getAsset()); | ||
assertEquals("Celestia wallet", balance.getSrc()); | ||
assertTrue(balance.getQty() >= 0.0f); | ||
} | ||
|
||
@Test | ||
void testNoBalances() { | ||
PrivateConfig.clearConfiguration(); | ||
|
||
CosmosJsProvider provider = GET_PROVIDER.get(); | ||
List<BalanceJson> balances = provider.balances(); | ||
assertTrue(balances.isEmpty()); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/test/java/com/allmycoins/balance/NeutronProviderTest.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,43 @@ | ||
package com.allmycoins.balance; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.List; | ||
import java.util.function.Supplier; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import com.allmycoins.PrivateConfig; | ||
import com.allmycoins.balance.cosmosjs.CosmosJsProvider; | ||
import com.allmycoins.balance.cosmosjs.CosmosJsProviders; | ||
import com.allmycoins.json.BalanceJson; | ||
|
||
final class NeutronProviderTest { | ||
|
||
private static final Supplier<CosmosJsProvider> GET_PROVIDER = () -> CosmosJsProviders.NEUTRON_PROVIDER; | ||
|
||
@Test | ||
void testBalances() { | ||
PrivateConfig.loadConfigurationFromClassLoader(); | ||
|
||
CosmosJsProvider provider = GET_PROVIDER.get(); | ||
List<BalanceJson> balances = provider.balances(); | ||
assertEquals(1, balances.size()); | ||
|
||
BalanceJson balance = balances.get(0); | ||
|
||
assertEquals("NTRN", balance.getAsset()); | ||
assertEquals("Neutron wallet", balance.getSrc()); | ||
assertTrue(balance.getQty() >= 0.0f); | ||
} | ||
|
||
@Test | ||
void testNoBalances() { | ||
PrivateConfig.clearConfiguration(); | ||
|
||
CosmosJsProvider provider = GET_PROVIDER.get(); | ||
List<BalanceJson> balances = provider.balances(); | ||
assertTrue(balances.isEmpty()); | ||
} | ||
} |
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