From ccb8f4cdd10db8c7d0de14a91b6b56660d0c5a02 Mon Sep 17 00:00:00 2001 From: Adrian Tiberius Date: Fri, 22 May 2015 22:24:18 +0200 Subject: [PATCH] Some files didn't upload to latest version. --- .../ethereum_android/EthereumApplication.java | 5 +- .../ethereum_android/di/PerActivity.java | 5 +- .../di/components/ActivityComponent.java | 5 +- .../di/components/ApplicationComponent.java | 5 +- .../EthereumApplicationComponent.java | 5 +- .../di/modules/ActivityModule.java | 5 +- .../di/modules/ApplicationModule.java | 5 +- .../di/components/BlockchainComponent.java | 5 +- .../di/components/EthereumComponent.java | 7 ++- .../ethereum/di/modules/EthereumModule.java | 49 ++++++++++++++++--- 10 files changed, 54 insertions(+), 42 deletions(-) diff --git a/app/src/main/java/org/ethereum/ethereum_android/EthereumApplication.java b/app/src/main/java/org/ethereum/ethereum_android/EthereumApplication.java index c98e9911..579ae80b 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/EthereumApplication.java +++ b/app/src/main/java/org/ethereum/ethereum_android/EthereumApplication.java @@ -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.modules.ApplicationModule; -/** - * Created by userica on 20.05.2015. - */ public class EthereumApplication extends MultiDexApplication { private ApplicationComponent applicationComponent = null; @@ -35,4 +32,4 @@ public class EthereumApplication extends MultiDexApplication { return applicationComponent; } -} +} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/PerActivity.java b/app/src/main/java/org/ethereum/ethereum_android/di/PerActivity.java index b9382001..3411639a 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/PerActivity.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/PerActivity.java @@ -6,9 +6,6 @@ import javax.inject.Scope; import static java.lang.annotation.RetentionPolicy.RUNTIME; -/** - * Created by userica on 22.05.2015. - */ @Scope @Retention(RUNTIME) -public @interface PerActivity {} +public @interface PerActivity {} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/components/ActivityComponent.java b/app/src/main/java/org/ethereum/ethereum_android/di/components/ActivityComponent.java index 9002df2c..110fa375 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/components/ActivityComponent.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/components/ActivityComponent.java @@ -7,12 +7,9 @@ import dagger.Component; import org.ethereum.ethereum_android.di.PerActivity; import org.ethereum.ethereum_android.di.modules.ActivityModule; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @PerActivity @Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class) public interface ActivityComponent { Activity activity(); -} +} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/components/ApplicationComponent.java b/app/src/main/java/org/ethereum/ethereum_android/di/components/ApplicationComponent.java index c2321898..b695bf1d 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/components/ApplicationComponent.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/components/ApplicationComponent.java @@ -9,9 +9,6 @@ import org.ethereum.facade.Ethereum; import dagger.Component; import javax.inject.Singleton; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @Singleton // Constraints this component to one-per-application or unscoped bindings. @Component(modules = ApplicationModule.class) public interface ApplicationComponent { @@ -19,4 +16,4 @@ public interface ApplicationComponent { //Exposed to sub-graphs. Context context(); -} +} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/components/EthereumApplicationComponent.java b/app/src/main/java/org/ethereum/ethereum_android/di/components/EthereumApplicationComponent.java index fcd1be50..e85b9605 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/components/EthereumApplicationComponent.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/components/EthereumApplicationComponent.java @@ -4,10 +4,7 @@ import android.content.Context; import org.ethereum.di.components.EthereumComponent; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ public interface EthereumApplicationComponent extends EthereumComponent { Context context(); -} +} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/modules/ActivityModule.java b/app/src/main/java/org/ethereum/ethereum_android/di/modules/ActivityModule.java index 37f250c7..fe9cb9d3 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/modules/ActivityModule.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/modules/ActivityModule.java @@ -11,9 +11,6 @@ import javax.inject.Singleton; import dagger.Module; import dagger.Provides; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @Module public class ActivityModule { @@ -30,4 +27,4 @@ public class ActivityModule { } -} +} \ No newline at end of file diff --git a/app/src/main/java/org/ethereum/ethereum_android/di/modules/ApplicationModule.java b/app/src/main/java/org/ethereum/ethereum_android/di/modules/ApplicationModule.java index 3e2b51d4..279c5bda 100644 --- a/app/src/main/java/org/ethereum/ethereum_android/di/modules/ApplicationModule.java +++ b/app/src/main/java/org/ethereum/ethereum_android/di/modules/ApplicationModule.java @@ -11,9 +11,6 @@ import javax.inject.Singleton; import dagger.Module; import dagger.Provides; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @Module public class ApplicationModule { @@ -29,4 +26,4 @@ public class ApplicationModule { } -} +} \ No newline at end of file diff --git a/ethereumj-core/src/main/java/org/ethereum/di/components/BlockchainComponent.java b/ethereumj-core/src/main/java/org/ethereum/di/components/BlockchainComponent.java index e7a9e830..ae61f8d9 100644 --- a/ethereumj-core/src/main/java/org/ethereum/di/components/BlockchainComponent.java +++ b/ethereumj-core/src/main/java/org/ethereum/di/components/BlockchainComponent.java @@ -7,10 +7,7 @@ import javax.inject.Singleton; import dagger.Component; -/** - * Created by Adrian Tiberius on 21.05.2015. - */ @Singleton @Component(modules = BlockchainModule.class) public interface BlockchainComponent { -} +} \ No newline at end of file diff --git a/ethereumj-core/src/main/java/org/ethereum/di/components/EthereumComponent.java b/ethereumj-core/src/main/java/org/ethereum/di/components/EthereumComponent.java index 8082a3c0..592ab92e 100644 --- a/ethereumj-core/src/main/java/org/ethereum/di/components/EthereumComponent.java +++ b/ethereumj-core/src/main/java/org/ethereum/di/components/EthereumComponent.java @@ -4,14 +4,12 @@ import android.content.Context; import org.ethereum.di.modules.EthereumModule; import org.ethereum.facade.Ethereum; +import org.ethereum.listener.EthereumListener; import javax.inject.Singleton; import dagger.Component; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @Singleton @Component(modules = EthereumModule.class) public interface EthereumComponent { @@ -20,4 +18,5 @@ public interface EthereumComponent { Context context(); Ethereum ethereum(); -} + EthereumListener listener(); +} \ No newline at end of file diff --git a/ethereumj-core/src/main/java/org/ethereum/di/modules/EthereumModule.java b/ethereumj-core/src/main/java/org/ethereum/di/modules/EthereumModule.java index 54819649..c3e6a5d8 100644 --- a/ethereumj-core/src/main/java/org/ethereum/di/modules/EthereumModule.java +++ b/ethereumj-core/src/main/java/org/ethereum/di/modules/EthereumModule.java @@ -19,21 +19,23 @@ import org.ethereum.manager.AdminInfo; import org.ethereum.manager.BlockLoader; import org.ethereum.manager.WorldManager; import org.ethereum.net.BlockQueue; +import org.ethereum.net.MessageQueue; import org.ethereum.net.client.PeerClient; import org.ethereum.net.eth.EthHandler; +import org.ethereum.net.p2p.P2pHandler; import org.ethereum.net.peerdiscovery.PeerDiscovery; import org.ethereum.net.server.ChannelManager; +import org.ethereum.net.server.EthereumChannelInitializer; import org.ethereum.net.shh.ShhHandler; +import org.ethereum.net.wire.MessageCodec; import org.ethereum.vm.ProgramInvokeFactory; +import javax.inject.Provider; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; -/** - * Created by Adrian Tiberius on 20.05.2015. - */ @Module public class EthereumModule { @@ -46,8 +48,8 @@ public class EthereumModule { @Provides @Singleton Ethereum provideEthereum(WorldManager worldManager, AdminInfo adminInfo, ChannelManager channelManager, - BlockLoader blockLoader, PeerClient backupPeerClient) { - return new EthereumImpl(worldManager, adminInfo, channelManager, blockLoader, backupPeerClient); + BlockLoader blockLoader, Provider peerClientProvider) { + return new EthereumImpl(worldManager, adminInfo, channelManager, blockLoader, peerClientProvider); } @Provides @@ -99,6 +101,18 @@ public class EthereumModule { return new PeerDiscovery(); } + @Provides + @Singleton + ChannelManager provideChannelManager() { + return new ChannelManager(); + } + + @Provides + @Singleton + BlockLoader provideBlockLoader() { + return new BlockLoader(); + } + @Provides EthHandler provideEthHandler() { return new EthHandler(); @@ -109,15 +123,38 @@ public class EthereumModule { return new ShhHandler(); } + @Provides + P2pHandler provideP2pHandler() { + return new P2pHandler(); + } + + @Provides + MessageCodec provideMessageCodec() { + return new MessageCodec(); + } + + @Provides + PeerClient providePeerClient(EthereumListener listener, ChannelManager channelManager, + Provider ethereumChannelInitializerProvider) { + return new PeerClient(listener, channelManager, ethereumChannelInitializerProvider); + } + + @Provides + MessageQueue provideMessageQueue() { + return new MessageQueue(); + } + @Provides @Singleton Context provideContext() { return context; } + + @Provides String provideRemoteId() { - return "e3d09d2f829950b5f3f82d1bddb6f5388bff2f2cca880fa47923df4d8129e8c9b5ba5d4371efcffc416b0cefe20cb55b81b2b71183464713a86e60b423b77947"; + return "bf01b54b6bc7faa203286dfb8359ce11d7b1fe822968fb4991f508d6f5a36ab7d9ae8af9b0d61c0467fb08567e0fb71cfb9925a370b69f9ede97927db473d1f5"; }