No PlainType again

This commit is contained in:
alari 2018-09-08 11:21:54 +02:00
parent c39467bb93
commit 291e8b70a2
5 changed files with 5 additions and 7 deletions

View File

@ -16,7 +16,7 @@ object MakeVyperApp extends App {
("address" address) ::
("owner" `public`(address)) ::
("holders" (address ~>> bool)) ::
("structMap" `public`(Mapping(uint256, struct))) ::
("structMap" `public`(uint256 ~>> struct)) ::
("struct" `public`(struct)) ::
("struct2" struct) :: HNil
)

View File

@ -1,5 +1,5 @@
package fluence.hackethberlin.types
case class Mapping[K <: PrimitiveType, V <: Type](ktype: K, vtype: V) extends PlainType {
case class Mapping[K <: PrimitiveType, V <: Type](ktype: K, vtype: V) extends Type {
override def toVyper: String = s"${vtype.toVyper}[${ktype.toVyper}]"
}

View File

@ -1,6 +1,6 @@
package fluence.hackethberlin.types
abstract sealed class PrimitiveType(name: String) extends PlainType {
abstract sealed class PrimitiveType(name: String) extends Type {
self
override def toVyper: String = name

View File

@ -2,6 +2,6 @@ package fluence.hackethberlin.types
import shapeless.{HList, LUBConstraint}
class StructType[D <: HList](dataDef: D)(implicit dv: DataVyper[D], c: LUBConstraint[D, (String, PlainType)]) extends PlainType {
class StructType[D <: HList](dataDef: D)(implicit dv: DataVyper[D], c: LUBConstraint[D, (String, Type)]) extends Type {
override def toVyper: String = s"{${dv.toVyperDefinitions(dataDef).mkString(", ")}}"
}

View File

@ -2,6 +2,4 @@ package fluence.hackethberlin.types
trait Type {
def toVyper: String
}
trait PlainType extends Type
}