]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php
Continued:
[hub.git] / application / hub / main / producer / miner / blocks / class_MinerTestGenesisBlockProducer.php
index 44ac83e6d0ba1813efb6a1545c65e0ad48174d43..e0329ac3ab13a3926844834fb574939b267ee2de 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProducer, Registerable {
+class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockProducer, Registerable {
        /**
         * Protected constructor
         *
@@ -41,6 +41,12 @@ class MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProd
                // Get new instance
                $producerInstance = new MinerTestGenesisBlockProducer();
 
+               // Get a (minable) hash block instance
+               $minableInstance = ObjectFactory::createObjectByConfiguredName('miner_test_hash_block_class');
+
+               // Set it here
+               $producerInstance->setMinableInstance($minableInstance);
+
                // Return the prepared instance
                return $producerInstance;
        }
@@ -54,6 +60,22 @@ class MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProd
         */
        protected function initProducer () {
                $this->partialStub('Please implement this method.');
+
+               // As last step, change the state of the miner, get the miner first
+               $minerInstance = Registry::getRegistry()->getInstance('miner');
+
+               // Change state to next state
+               $minerInstance->blockProducerHasInitialized();
+       }
+
+       /**
+        * Initializes the executor, whatever it does.
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function initExecutor (Stateable $stateInstance) {
+               $this->partialStub('Please implement this method.');
        }
 
        /**
@@ -63,7 +85,7 @@ class MinerTestGenesisBlockProducer extends BaseUnitProducer implements UnitProd
         * @return      void
         * @todo        0% done
         */
-       public function prepareUnitProduction (Stateable $stateInstance) {
+       public function prepareBlockProduction (Stateable $stateInstance) {
                $this->partialStub('Please implement this method, stateInstance=' . $stateInstance->__toString());
        }
 }