Merge branch 'publisher'

This commit is contained in:
Dmitry Sergeev 2018-09-09 11:03:26 +02:00
commit 618f4175f8
4 changed files with 29 additions and 12 deletions

View File

@ -19,13 +19,17 @@ val commons = Seq(
resolvers += Resolver.sonatypeRepo("releases"),
scalafmtOnCompile := true,
// see good explanation https://gist.github.com/djspiewak/7a81a395c461fd3a09a6941d4cd040f2
scalacOptions += "-Ypartial-unification"
scalacOptions += "-Ypartial-unification",
organization := "one.fluence",
bintrayOrganization := Some("fluencelabs"),
)
commons
lazy val core = project.settings(
lazy val crotalinae = project.in(file("core")).settings(
commons,
artifact := Artifact("crotalinae"),
version := "0.0.4",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "1.2.0",
"org.typelevel" %% "cats-free" % "1.2.0",
@ -38,9 +42,10 @@ lazy val core = project.settings(
lazy val root = project
.in(file("."))
.dependsOn(core)
.aggregate(core)
.dependsOn(crotalinae)
.aggregate(crotalinae)
.settings(
libraryDependencies ++= Seq("com.chuusai" %% "shapeless" % "2.3.3"),
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)
libraryDependencies ++= Seq("com.chuusai" %% "shapeless" % "2.3.3"),
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
publishArtifact := false
)

View File

@ -1 +1,3 @@
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.4.0")
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.4.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")

11
scastie-settings.sbt_ Normal file
View File

@ -0,0 +1,11 @@
// use https://scastie.scala-lang.org/
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-unchecked"
)
resolvers += Resolver.bintrayRepo("fluencelabs", "maven")
libraryDependencies += "org.typelevel" %% "cats-core" % "1.2.0"
libraryDependencies += "one.fluence" %% "crotalinae" % "0.0.4"
libraryDependencies += "com.chuusai" %% "shapeless" % "2.3.3"

View File

@ -1,7 +1,7 @@
package fluence
import hackethberlin._
import hackethberlin.types._
import fluence.hackethberlin._
import fluence.hackethberlin.types._
import shapeless._
import Decorator._
import syntax.singleton._
@ -51,9 +51,8 @@ object Auction extends App {
for {
_ <- `assert`(`<<`(`block.timestamp`, auction_end))
_ <- `assert`(`>>`(`msg.value`, highest_bid))
_ <- `if`(`not`(`:===:`(highest_bid, `msg.value`)), {
() =>
send(highest_bidder :: highest_bid :: HNil).liftF.map(_ => Void)
_ <- `if`(`not`(`:===:`(highest_bid, `msg.value`)), { () =>
send(highest_bidder :: highest_bid :: HNil).liftF.map(_ => Void)
})
_ <- highest_bidder :=: `msg.sender`
_ <- highest_bid :=: `msg.value`