Some files didn't upload to latest version.

This commit is contained in:
Adrian Tiberius 2015-05-22 22:24:18 +02:00
parent 9b29b9ea95
commit ccb8f4cdd1
10 changed files with 54 additions and 42 deletions

View File

@ -11,9 +11,6 @@ import org.ethereum.ethereum_android.di.components.ApplicationComponent;
import org.ethereum.ethereum_android.di.components.DaggerApplicationComponent; import org.ethereum.ethereum_android.di.components.DaggerApplicationComponent;
import org.ethereum.ethereum_android.di.modules.ApplicationModule; import org.ethereum.ethereum_android.di.modules.ApplicationModule;
/**
* Created by userica on 20.05.2015.
*/
public class EthereumApplication extends MultiDexApplication { public class EthereumApplication extends MultiDexApplication {
private ApplicationComponent applicationComponent = null; private ApplicationComponent applicationComponent = null;
@ -35,4 +32,4 @@ public class EthereumApplication extends MultiDexApplication {
return applicationComponent; return applicationComponent;
} }
} }

View File

@ -6,9 +6,6 @@ import javax.inject.Scope;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Created by userica on 22.05.2015.
*/
@Scope @Scope
@Retention(RUNTIME) @Retention(RUNTIME)
public @interface PerActivity {} public @interface PerActivity {}

View File

@ -7,12 +7,9 @@ import dagger.Component;
import org.ethereum.ethereum_android.di.PerActivity; import org.ethereum.ethereum_android.di.PerActivity;
import org.ethereum.ethereum_android.di.modules.ActivityModule; import org.ethereum.ethereum_android.di.modules.ActivityModule;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@PerActivity @PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class) @Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent { public interface ActivityComponent {
Activity activity(); Activity activity();
} }

View File

@ -9,9 +9,6 @@ import org.ethereum.facade.Ethereum;
import dagger.Component; import dagger.Component;
import javax.inject.Singleton; import javax.inject.Singleton;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@Singleton // Constraints this component to one-per-application or unscoped bindings. @Singleton // Constraints this component to one-per-application or unscoped bindings.
@Component(modules = ApplicationModule.class) @Component(modules = ApplicationModule.class)
public interface ApplicationComponent { public interface ApplicationComponent {
@ -19,4 +16,4 @@ public interface ApplicationComponent {
//Exposed to sub-graphs. //Exposed to sub-graphs.
Context context(); Context context();
} }

View File

@ -4,10 +4,7 @@ import android.content.Context;
import org.ethereum.di.components.EthereumComponent; import org.ethereum.di.components.EthereumComponent;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
public interface EthereumApplicationComponent extends EthereumComponent { public interface EthereumApplicationComponent extends EthereumComponent {
Context context(); Context context();
} }

View File

@ -11,9 +11,6 @@ import javax.inject.Singleton;
import dagger.Module; import dagger.Module;
import dagger.Provides; import dagger.Provides;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@Module @Module
public class ActivityModule { public class ActivityModule {
@ -30,4 +27,4 @@ public class ActivityModule {
} }
} }

View File

@ -11,9 +11,6 @@ import javax.inject.Singleton;
import dagger.Module; import dagger.Module;
import dagger.Provides; import dagger.Provides;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@Module @Module
public class ApplicationModule { public class ApplicationModule {
@ -29,4 +26,4 @@ public class ApplicationModule {
} }
} }

View File

@ -7,10 +7,7 @@ import javax.inject.Singleton;
import dagger.Component; import dagger.Component;
/**
* Created by Adrian Tiberius on 21.05.2015.
*/
@Singleton @Singleton
@Component(modules = BlockchainModule.class) @Component(modules = BlockchainModule.class)
public interface BlockchainComponent { public interface BlockchainComponent {
} }

View File

@ -4,14 +4,12 @@ import android.content.Context;
import org.ethereum.di.modules.EthereumModule; import org.ethereum.di.modules.EthereumModule;
import org.ethereum.facade.Ethereum; import org.ethereum.facade.Ethereum;
import org.ethereum.listener.EthereumListener;
import javax.inject.Singleton; import javax.inject.Singleton;
import dagger.Component; import dagger.Component;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@Singleton @Singleton
@Component(modules = EthereumModule.class) @Component(modules = EthereumModule.class)
public interface EthereumComponent { public interface EthereumComponent {
@ -20,4 +18,5 @@ public interface EthereumComponent {
Context context(); Context context();
Ethereum ethereum(); Ethereum ethereum();
} EthereumListener listener();
}

View File

@ -19,21 +19,23 @@ import org.ethereum.manager.AdminInfo;
import org.ethereum.manager.BlockLoader; import org.ethereum.manager.BlockLoader;
import org.ethereum.manager.WorldManager; import org.ethereum.manager.WorldManager;
import org.ethereum.net.BlockQueue; import org.ethereum.net.BlockQueue;
import org.ethereum.net.MessageQueue;
import org.ethereum.net.client.PeerClient; import org.ethereum.net.client.PeerClient;
import org.ethereum.net.eth.EthHandler; import org.ethereum.net.eth.EthHandler;
import org.ethereum.net.p2p.P2pHandler;
import org.ethereum.net.peerdiscovery.PeerDiscovery; import org.ethereum.net.peerdiscovery.PeerDiscovery;
import org.ethereum.net.server.ChannelManager; import org.ethereum.net.server.ChannelManager;
import org.ethereum.net.server.EthereumChannelInitializer;
import org.ethereum.net.shh.ShhHandler; import org.ethereum.net.shh.ShhHandler;
import org.ethereum.net.wire.MessageCodec;
import org.ethereum.vm.ProgramInvokeFactory; import org.ethereum.vm.ProgramInvokeFactory;
import javax.inject.Provider;
import javax.inject.Singleton; import javax.inject.Singleton;
import dagger.Module; import dagger.Module;
import dagger.Provides; import dagger.Provides;
/**
* Created by Adrian Tiberius on 20.05.2015.
*/
@Module @Module
public class EthereumModule { public class EthereumModule {
@ -46,8 +48,8 @@ public class EthereumModule {
@Provides @Provides
@Singleton @Singleton
Ethereum provideEthereum(WorldManager worldManager, AdminInfo adminInfo, ChannelManager channelManager, Ethereum provideEthereum(WorldManager worldManager, AdminInfo adminInfo, ChannelManager channelManager,
BlockLoader blockLoader, PeerClient backupPeerClient) { BlockLoader blockLoader, Provider<PeerClient> peerClientProvider) {
return new EthereumImpl(worldManager, adminInfo, channelManager, blockLoader, backupPeerClient); return new EthereumImpl(worldManager, adminInfo, channelManager, blockLoader, peerClientProvider);
} }
@Provides @Provides
@ -99,6 +101,18 @@ public class EthereumModule {
return new PeerDiscovery(); return new PeerDiscovery();
} }
@Provides
@Singleton
ChannelManager provideChannelManager() {
return new ChannelManager();
}
@Provides
@Singleton
BlockLoader provideBlockLoader() {
return new BlockLoader();
}
@Provides @Provides
EthHandler provideEthHandler() { EthHandler provideEthHandler() {
return new EthHandler(); return new EthHandler();
@ -109,15 +123,38 @@ public class EthereumModule {
return new ShhHandler(); return new ShhHandler();
} }
@Provides
P2pHandler provideP2pHandler() {
return new P2pHandler();
}
@Provides
MessageCodec provideMessageCodec() {
return new MessageCodec();
}
@Provides
PeerClient providePeerClient(EthereumListener listener, ChannelManager channelManager,
Provider<EthereumChannelInitializer> ethereumChannelInitializerProvider) {
return new PeerClient(listener, channelManager, ethereumChannelInitializerProvider);
}
@Provides
MessageQueue provideMessageQueue() {
return new MessageQueue();
}
@Provides @Provides
@Singleton @Singleton
Context provideContext() { Context provideContext() {
return context; return context;
} }
@Provides @Provides
String provideRemoteId() { String provideRemoteId() {
return "e3d09d2f829950b5f3f82d1bddb6f5388bff2f2cca880fa47923df4d8129e8c9b5ba5d4371efcffc416b0cefe20cb55b81b2b71183464713a86e60b423b77947"; return "bf01b54b6bc7faa203286dfb8359ce11d7b1fe822968fb4991f508d6f5a36ab7d9ae8af9b0d61c0467fb08567e0fb71cfb9925a370b69f9ede97927db473d1f5";
} }