mirror of
https://github.com/fluencelabs/hackethberlin
synced 2025-04-24 17:02:18 +00:00
No PlainType again
This commit is contained in:
parent
c39467bb93
commit
291e8b70a2
@ -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
|
||||
)
|
||||
|
@ -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}]"
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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(", ")}}"
|
||||
}
|
||||
|
@ -2,6 +2,4 @@ package fluence.hackethberlin.types
|
||||
|
||||
trait Type {
|
||||
def toVyper: String
|
||||
}
|
||||
|
||||
trait PlainType extends Type
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user