mirror of
https://github.com/fluencelabs/hackethberlin
synced 2025-04-25 17:32:16 +00:00
Formatting
This commit is contained in:
parent
3c0d3599d1
commit
8bc3f6c194
@ -4,6 +4,7 @@ import fluence.hackethberlin.types.DataVyper
|
|||||||
import shapeless.HList
|
import shapeless.HList
|
||||||
|
|
||||||
class Contract[D <: HList](instructions: D)(implicit dv: DataVyper[D]) {
|
class Contract[D <: HList](instructions: D)(implicit dv: DataVyper[D]) {
|
||||||
|
|
||||||
def toVyper: String =
|
def toVyper: String =
|
||||||
dv.toVyperDefinitions(instructions).mkString("\n")
|
dv.toVyperDefinitions(instructions).mkString("\n")
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package fluence.hackethberlin.types
|
package fluence.hackethberlin.types
|
||||||
|
|
||||||
import fluence.hackethberlin.{FuncDef, types}
|
import fluence.hackethberlin.{types, FuncDef}
|
||||||
import shapeless._
|
import shapeless._
|
||||||
import shapeless.labelled.FieldType
|
import shapeless.labelled.FieldType
|
||||||
import shapeless.tag._
|
import shapeless.tag._
|
||||||
@ -36,7 +36,8 @@ sealed trait LowPriorityDataVyperImplicits {
|
|||||||
data.toDataVyper :: Nil
|
data.toDataVyper :: Nil
|
||||||
}
|
}
|
||||||
|
|
||||||
implicit def funcDefDataVyper[Args <: HList, Ret <: types.Type, Params <: HList]: DataVyper[FuncDef[Args, Ret, Params]] =
|
implicit def funcDefDataVyper[Args <: HList, Ret <: types.Type, Params <: HList]
|
||||||
|
: DataVyper[FuncDef[Args, Ret, Params]] =
|
||||||
new DataVyper[FuncDef[Args, Ret, Params]] {
|
new DataVyper[FuncDef[Args, Ret, Params]] {
|
||||||
override def toVyperDefinitions(func: FuncDef[Args, Ret, Params]): List[String] =
|
override def toVyperDefinitions(func: FuncDef[Args, Ret, Params]): List[String] =
|
||||||
func.toVyper :: Nil
|
func.toVyper :: Nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user