 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defn test-activity [from-name amount to-name]
+(defn render-activity [transaction]
+  {"type"     "Transaction"
+   "published" (str (time/format (time/datetime)) "Z")
+   "actor"     {"type"       "Person"
+                "displayName" (:from transaction)}
+   "target"    {"type"       "Person"
+                "displayName" (:to transaction)}
+   "object"    {"type"       "STUB"
+               "displayName" (str (:amount transaction))
+               "url" (str (env/env :base-url) "/transactions/UID")}
+   })
+  
+(defn test-activity [transactions]
   {"@context"  "https://www.w3.org/ns/activitystreams"
-   "@type"     "Transaction"
-   "published" (str (time/format (time/datetime)) "Z")
-   "actor"     {"@type"       "Person"
-                "displayName" from-name}
-   "target"    {"@type"       "Person"
-                "displayName" to-name}
-   "object"    {"@type"       "STUB"
-                "displayName" (str amount)
-                "url" (str (env/env :base-url) "/transactions/UID")
-                }})
+   "type"      "Container"
+   "name"      "Activity stream"
+   "totalItems" (count transactions)
+   "items"     (map #(render-activity %) transactions)})
 
 (defn no-variables [activity]
   (-> activity
-      (dissoc "published")
-      (update-in ["object"] dissoc "url"))
+      (dissoc "items")
+      )
+      ;; (update-in ["object"] dissoc "url"))
   )
 
 (defn assert-timeless-activitystream [state contents]

             )))


(facts "Activitystreams JSON contains transaction log as soon as transactions are done on blockchain"
       (let [memory (atom {})]
         (ih/reset-db)
         (-> (k/session test-app)

             (check-page-is-activity-stream :get-activity-streams)

             (assert-timeless-activitystream
              [(test-activity [{:from "sender" :amount 101 :to "recipient"}
                               {:from "sender" :amount 99  :to "recipient"}])])
             )))


#(facts "Activitystreams JSON can be filtered on time with from/to parameters"
       (let [memory (atom {})]
         (ih/reset-db)
         (-> (k/session test-app)
