Giter Club home page Giter Club logo

ethdroid's Issues

Define and adopt good practices for testing

Currently, tests don't follow good practices.

Good practices can be found in the list bellow (which can be updated with comments) :

  • Use @Before and @After as much as possible (instead of calling same methods every where)
  • Remove multiple tests in single assertion (using &&)
  • Use assertThat(...) instead of assertTrue(...)

Maven: compileOnly dependencies are missing from pom.xml

Geth, configured as a "compileOnly" dependency, is missing from generated Maven pom.xml file.

It should be declared as:

    <dependency>
      <groupId>org.ethereum</groupId>
      <artifactId>geth</artifactId>
      <version>1.6.3</version>
      <scope>compile</scope>
    </dependency>

Issue probably comes from Android Maven Gradle Plugin, which configures only "compile" scope dependencies (see https://github.com/dcendents/android-maven-gradle-plugin/blob/master/src/main/java/org/gradle/api/plugins/AndroidMavenPlugin.java#L189)

Ethdroid crashes with OutOfBoundsException

Ethdroid throws an OutOfBoundsException when creating an instance of Ethdroid with a referenced but empty key manager.

The reason is that, by default Ethdroid's Builder sets as main account the first account of the key manager (if referenced). But it doesn't verify if referenced key manager has accounts.

Automatic snapshot publication from travis

We have to add a task in travis script to automate snapshots publication on oss.jfrog.

Snapshots are based on master branch.

  • Add encrypted keys into .travis.yml
  • add artifactoryPublish in .travis.yml
  • restrict artifactoryPublish to master branch
  • restrict artifactoryPublish to manual commits (not those from Gradle Release Plugin)

Complete README

  • Mention the project follows semantic versionning
  • Authors (all) a1d4038
  • Add use cases
  • More explanations on Dapp
  • Update architecture diagram (IPC, Geth 1.4)

Consider relicensing to LGPL or GPL

Ethereum-android used to communicate with Geth through network (IPC or HTTP/RPC), so LGPL/GPL licenses of Geth were not viral.

But Ethdroid now communicates with Geth through JNI, which is known to be viral:

So Ethdroid should probably be relicensing to LGPL/GPL. This issue to check that.
@Nigui Ethdroid can't be distributed (any!) without solving this issue.

Invalid Sender when sending transaction

When node starts already synced and before it receives new blocs, an exception is thrown by keystore.signTx saying : Invalid sender.

It's an issue related to go-ethereum implementation which can be seen here.

The fix has been merged in geth 1.6.6, but issue is still in Ethdroid.

May be the way we sign transaction is wrong.

Must be investigated.

How to send ether using ethdroid

I would like to send ether from 1 account to other account using ethdroid api but I couldn't find api to do it.

Could you please tell me steps for sending ether api flow?

Verify geth dependency version at runtime

Ethdroid must verify at runtime the geth dependency version set by user, to prevent unreadable thrown exception.

  • Fork go-ethereum and add the 'GetVersion' method in mobile directory.
  • Submit a pull-request
  • Update Ethdroid dependency to latest geth version
  • Make the verification in Ethdroid

Value configuration for smart-contract calls (local and persistant)

Currently, to call (local and persistant) a smart-contract you must do this :

contract.function(/*parameters*/).sendWithNotification();
// or
contract.function(/*parameters*/).send();
// or
contract.function(/*parameters*/).call();

Currently it's not possible to configure value attached to the call. By default value is 0 (see).

Some smart-contract functions require attached value to be valid (ones with payable in signature).

Value must be configurable for these three types of calls.

NoSuchMethodError with rxjava and lambda

Context :

When Ethdroid catches a Solidity event and starts to decode it.

Doesn't work ( from SolidityEvent ):

Filter.newLogFilter(eth, options)
    .map(log -> {
        if (returns.size() == 0) {
            return null;
        } else {
            return SCoder.decodeParams(ByteString.of(log.getData()).hex(), returns);
        }
    });

Full error on pastebin
Zoom on error message :

Pending exception java.lang.NoSuchMethodError thrown by 'unknown throw location'
java.lang.NoSuchMethodError: No static method lambda$createFilterAndDecode$0(Lio/ethmobile/ethdroid/solidity/element/event/SolidityEvent;Lorg/ethereum/geth/Log;)[Lio/ethmobile/ethdroid/solidity/types/SType; in class Lio/ethmobile/ethdroid/solidity/element/event/SolidityEvent; or its super classes (declaration of 'io.ethmobile.ethdroid.solidity.element.event.SolidityEvent' appears in /data/app/io.ethmobile.ethdroidsample-2/split_lib_slice_9_apk.apk)
  at java.lang.Object io.ethmobile.ethdroid.solidity.element.event.SolidityEvent$$Lambda$1.call(java.lang.Object) ((null):0)
  at void rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(java.lang.Object) (OnSubscribeMap.java:69)
  at void rx.internal.operators.OperatorSubscribeOn$1$1.onNext(java.lang.Object) (OperatorSubscribeOn.java:53)
  at void io.ethmobile.ethdroid.model.Filter$LogListener.onFilterLogs(org.ethereum.geth.Log) (Filter.java:127)

Works :

Filter.newLogFilter(eth, options)
    .map(new Func1<Log, SType[]>() {
        @Override
        public SType[] call(Log log) {
            if (returns.size() == 0) {
                return null;
            } else {
                return SCoder.decodeParams(ByteString.of(log.getData()).hex(), returns);
            }
        }
     });

Gas configuration for smart-contract calls (local and persistent)

Currently, to call (local and persistant) a smart-contract you must do this :

contract.function(/*parameters*/).sendWithNotification();
// or
contract.function(/*parameters*/).send();
// or
contract.function(/*parameters*/).call();

It's not possible to configure gas. Gas amount sent with the call is a default value

Gas amount and price must be configurable for these three types of calls.

Refactor build process

Android specs:

  • level Android 21 / 5.0

Project specs:

  • Java 8 syntax
  • Instrumented test on Android 22
  • Clear release process (based on a Gradle plugin ?)
  • Publishing:
    • Use io.ethmobile.ethdroid Maven groupId
    • Snapshots -> Jitpack
    • Release -> JCenter (through SQLI Bintray account)
    • process : build -> bintrayUpload
  • Refactor package names: com.sqli.* -> io.ethmobile.*

Cleanup warnings

/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:10: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:11: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Context;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:12: error: package org.ethereum.geth does not exist
import org.ethereum.geth.EthereumClient;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:13: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:14: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Header;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Node;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:16: error: package org.ethereum.geth does not exist
import org.ethereum.geth.SyncProgress;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:18: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:27: error: cannot find symbol
    private Context mainContext;
            ^
  symbol:   class Context
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:28: error: cannot find symbol
    private Node node;
            ^
  symbol:   class Node
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Enodes;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.NodeConfig;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:30: error: cannot find symbol
    private EthereumClient client;
            ^
  symbol:   class EthereumClient
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:6: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Accounts;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.KeyStore;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:32: error: cannot find symbol
    private Account mainAccount;
            ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Account;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Address;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:9: error: package org.ethereum.geth does not exist
import org.ethereum.geth.BigInt;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:10: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Block;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:11: error: package org.ethereum.geth does not exist
import org.ethereum.geth.CallMsg;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:12: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Context;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:13: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:14: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.KeyStore;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:17: error: package okio does not exist
import okio.ByteString;
           ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:18: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:56: error: cannot find symbol
    public Observable<Header> newHeadFilter(){
           ^
  symbol:   class Observable
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:56: error: cannot find symbol
    public Observable<Header> newHeadFilter(){
                      ^
  symbol:   class Header
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:64: error: cannot find symbol
    public Balance getBalanceOf(Account account) throws Exception {
                                ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:167: error: cannot find symbol
    public Context getMainContext() {
           ^
  symbol:   class Context
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:170: error: cannot find symbol
    public EthereumClient getClient() {
           ^
  symbol:   class EthereumClient
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:176: error: cannot find symbol
    public Account getMainAccount() {
           ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:189: error: cannot find symbol
    private static void setMainAccount(EthDroid eth,Account mainAccount){
                                                    ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:205: error: cannot find symbol
    public void setMainAccount(Account mainAccount) {
                               ^
  symbol:   class Account
  location: class EthDroid
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:28: error: cannot find symbol
    NodeConfig nodeConfig;
    ^
  symbol:   class NodeConfig
  location: class ChainConfig
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:20: error: cannot find symbol
    private KeyStore keystore;
            ^
  symbol:   class KeyStore
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:33: error: cannot find symbol
    public Account newAccount(String passphrase) throws Exception {
           ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:37: error: cannot find symbol
    public Account newUnlockedAccount(String passphrase) throws Exception{
           ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:43: error: cannot find symbol
    public List<Account> getAccounts() throws Exception{
                ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:52: error: cannot find symbol
    public boolean accountExists(Account account){
                                 ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:57: error: cannot find symbol
    public boolean accountIsLocked(Account account){
                                   ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:67: error: cannot find symbol
    public void lockAccount(Account account) throws Exception {
                            ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:71: error: cannot find symbol
    public void unlockAccount(Account account,String passphrase) throws Exception{
                              ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:75: error: cannot find symbol
    public void unlockAccountDuring(Account account,String passphrase,long seconds) throws Exception {
                                    ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:79: error: cannot find symbol
    public void deleteAccount(Account account,String passphrase) throws Exception{
                              ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:83: error: cannot find symbol
    public void updateAccountPassphrase(Account account,String passphrase,String newPassphrase) throws Exception{
                                        ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:87: error: cannot find symbol
    public byte[] signString(Account account,String toSign) throws Exception{
                             ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:92: error: cannot find symbol
    public byte[] unlockAndsignString(Account account,String password,String toSign) throws Exception{
                                      ^
  symbol:   class Account
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/KeyManager.java:97: error: cannot find symbol
    public KeyStore getKeystore() {
           ^
  symbol:   class KeyStore
  location: class KeyManager
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:38: error: cannot find symbol
    private Address to;
            ^
  symbol:   class Address
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:39: error: cannot find symbol
    private Account from;
            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:41: error: cannot find symbol
    private BigInt value;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:42: error: cannot find symbol
    private BigInt gas;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:43: error: cannot find symbol
    private BigInt gasPrice;
            ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:46: error: cannot find symbol
    private Context txContext;
            ^
  symbol:   class Context
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:78: error: cannot find symbol
    public Transaction to(Address account){
                          ^
  symbol:   class Address
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:86: error: cannot find symbol
    public Transaction from(Account account, String passphrase){
                            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:92: error: cannot find symbol
    public Transaction from(Account account){
                            ^
  symbol:   class Account
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:98: error: cannot find symbol
    public Transaction value(BigInt value){
                             ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:105: error: cannot find symbol
    public Transaction gasAmount(BigInt gas){
                                 ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:109: error: cannot find symbol
    public Transaction gasPrice(BigInt gasPrice){
                                ^
  symbol:   class BigInt
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:129: error: cannot find symbol
    public Transaction context(Context context){
                               ^
  symbol:   class Context
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:145: error: package org.ethereum.geth does not exist
    public org.ethereum.geth.Transaction getRawTransaction() throws Exception {
                            ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:150: error: package org.ethereum.geth does not exist
    private org.ethereum.geth.Transaction sign() throws Exception{
                             ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:161: error: cannot find symbol
    private CallMsg toCallMessage() throws Exception{
            ^
  symbol:   class CallMsg
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:178: error: cannot find symbol
    public Hash send() throws Exception{
           ^
  symbol:   class Hash
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:184: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception{
           ^
  symbol:   class Observable
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/Transaction.java:184: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception{
                      ^
  symbol:   class Block
  location: class Transaction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/EthDroid.java:148: error: cannot find symbol
        public Builder withMainAccount(Account mainAccount){
                                       ^
  symbol:   class Account
  location: class Builder
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/ChainConfig.java:221: error: cannot find symbol
        private static Enodes listToEnodes(List<String> enodesList){
                       ^
  symbol:   class Enodes
  location: class Builder
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Transactions;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:193: error: cannot find symbol
    public static boolean transactionListContains(Transactions transactions, Hash txHash) throws Exception {
                                                  ^
  symbol:   class Transactions
  location: class Utils
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/Utils.java:193: error: cannot find symbol
    public static boolean transactionListContains(Transactions transactions, Hash txHash) throws Exception {
                                                                             ^
  symbol:   class Hash
  location: class Utils
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:18: error: package okio does not exist
import okio.ByteString;
           ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:19: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:3: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Address;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:4: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Addresses;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:5: error: package org.ethereum.geth does not exist
import org.ethereum.geth.FilterQuery;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:6: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Geth;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:7: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hashes;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:8: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Topics;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:44: error: cannot find symbol
    Observable<SType[]> createFilterAndDecode() throws Exception {
    ^
  symbol:   class Observable
  location: class SolidityEvent<T>
  where T is a type-variable:
    T extends SType declared in class SolidityEvent
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/event/SolidityEvent.java:55: error: cannot find symbol
    public Observable<SingleReturn<T>> listen() throws Exception {
           ^
  symbol:   class Observable
  location: class SolidityEvent<T>
  where T is a type-variable:
    T extends SType declared in class SolidityEvent
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:17: error: cannot find symbol
    FilterQuery query;
    ^
  symbol:   class FilterQuery
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:32: error: cannot find symbol
    public FilterOptions addAddress(Address address){
                                    ^
  symbol:   class Address
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:53: error: cannot find symbol
    public FilterQuery getQuery() {
           ^
  symbol:   class FilterQuery
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/model/FilterOptions.java:57: error: cannot find symbol
    private static Hashes fromListToHashes(List<String> list) throws Exception {
                   ^
  symbol:   class Hashes
  location: class FilterOptions
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:15: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Block;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:16: error: package org.ethereum.geth does not exist
import org.ethereum.geth.Hash;
                        ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:25: error: package rx does not exist
import rx.Observable;
         ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:72: error: cannot find symbol
    public Hash send() throws Exception {
           ^
  symbol:   class Hash
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:75: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception {
           ^
  symbol:   class Observable
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/element/function/SolidityFunction.java:75: error: cannot find symbol
    public Observable<Block> sendWithNotification() throws Exception {
                      ^
  symbol:   class Block
  location: class SolidityFunction<T>
  where T is a type-variable:
    T extends SType declared in class SolidityFunction
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/SolidityUtils.java:4: error: package com.google.gson does not exist
import com.google.gson.JsonArray;
                      ^
/ethdroid/ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/SolidityUtils.java:5: error: package com.google.gson does not exist
import com.google.gson.JsonObject;
100 warnings

Adopt an exception management strategy

Lot of JNI calls throw Exceptions.
For now, management is in charge of the library user.
Maybe we can find a way to manage them for the user :

  • Throw RuntimeException for each Exception thrown ?
  • Throw Custom Exception for each Exception thrown, depending on its message.
    ex. : Exception("not enought gas") --> OutOfGasException()

Fresh checkout doesn't build

After a fresh checkout of branch geth_1.6, ./gradlew build fails:

$ ./gradlew build
Configuration 'compile' in project ':ethdroid' is deprecated. Use 'implementation' instead.
Configuration 'androidTestCompile' in project ':ethdroid' is deprecated. Use 'androidTestImplementation' instead.
Configuration 'testCompile' in project ':ethdroid' is deprecated. Use 'testImplementation' instead.

FAILURE: Build failed with an exception.

* Where:
Script '/ethdroid/ethdroid/bintray.gradle' line: 34

* What went wrong:
A problem occurred evaluating script.
> /ethdroid/local.properties (No such file or directory)

It works with a local.properties file.

Enable Verbosity setting

To modify verbosity of node logs, you have to call Geth.setVerbosity(ID_VERBOSITY).
Maybe we can integrate it direclty into the library with the use of an enum in order to document every level of verbosity.

  • verify if Geth.setVerbosity() must be called before node starts
  • add a method to call Geth.setVerbosity()
  • add an enum as input of the method
  • document the method and enum

First call on contract method throws Exception

D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: data == null
I/Choreographer: Skipped 30 frames!  The application may be doing too much work on its main thread.
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: 0
I/Choreographer: Skipped 35 frames!  The application may be doing too much work on its main thread.
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
D/ETHDROID_SAMPLE: 0
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
I/art: Background partial concurrent mark sweep GC freed 205398(7MB) AllocSpace objects, 0(0B) LOS objects, 40% free, 18MB/31MB, paused 2.410ms total 122.833ms
D/ETHDROID_SAMPLE: 0

Logs from ethdroid-sample
When calling a smart-contract from UI, the first attempt fails.
But next attempts return the expected behaviour ( the value 0 ).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.