6 amountType = typeDesc("Amount")
7 assetType = typeDesc("Asset")
8 boolType = typeDesc("Boolean")
9 contractType = typeDesc("Contract")
10 hashType = typeDesc("Hash")
11 intType = typeDesc("Integer")
12 listType = typeDesc("List")
13 nilType = typeDesc("")
14 predType = typeDesc("Predicate")
15 progType = typeDesc("Program")
16 pubkeyType = typeDesc("PublicKey")
17 sigType = typeDesc("Signature")
18 strType = typeDesc("String")
20 sha3StrType = typeDesc("Sha3(String)")
21 sha3PubkeyType = typeDesc("Sha3(PublicKey)")
22 sha256StrType = typeDesc("Sha256(String)")
23 sha256PubkeyType = typeDesc("Sha256(PublicKey)")
26 var types = map[string]typeDesc{
27 string(amountType): amountType,
28 string(assetType): assetType,
29 string(boolType): boolType,
30 string(hashType): hashType,
31 string(intType): intType,
32 string(listType): listType,
33 string(nilType): nilType,
34 string(predType): predType,
35 string(progType): progType,
36 string(pubkeyType): pubkeyType,
37 string(sigType): sigType,
38 string(strType): strType,
40 string(sha3StrType): sha3StrType,
41 string(sha3PubkeyType): sha3PubkeyType,
42 string(sha256StrType): sha256StrType,
43 string(sha256PubkeyType): sha256PubkeyType,
46 func isHashSubtype(t typeDesc) bool {
48 case sha3StrType, sha3PubkeyType, sha256StrType, sha256PubkeyType:
54 func propagateType(contract *Contract, clause *Clause, env *environ, t typeDesc, e expression) {
59 if entry := env.lookup(string(v)); entry != nil {
61 for _, p := range contract.Params {
62 if p.Name == string(v) {
67 for _, p := range clause.Params {
68 if p.Name == string(v) {