bitcoin-atm

bitcoin atm for pyc inc.

git clone https://9o.is/git/bitcoin-atm.git

Transaction.scala

(604B)


      1 package inc.pyc.chimera
      2 package minions
      3 
      4 import ddb._
      5 import akka.actor._
      6 
      7 /**
      8  * Minion that has access to the DDB Transaction Table.
      9  */
     10 class TransactionMinion
     11   extends Actor 
     12   with ActorLogging 
     13   with Minion
     14   with MinionWorker
     15   with DDBMinion {
     16 
     17   def props: Props = Props[Transaction]
     18   def name: String = "Transaction_"+util.Random.nextInt
     19 
     20   val tasks: Receive = {
     21     case tx: CompleteTx => saveTransaction(tx)
     22   }
     23   
     24   /**
     25    * Saves completed transaction to Dynamo DB's Transaction table.
     26    * @param tx completed transaction
     27    */
     28   def saveTransaction(tx: CompleteTx) = workout(_ ! tx)
     29 }