aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go')
-rw-r--r--Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go b/Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go
new file mode 100644
index 000000000..2f2d17784
--- /dev/null
+++ b/Godeps/_workspace/src/github.com/ethereum/serpent-go/tests/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "fmt"
+
+ "github.com/ethereum/serpent-go"
+)
+
+func main() {
+ out, _ := serpent.Compile(`
+// Namecoin
+if !contract.storage[msg.data[0]]: # Is the key not yet taken?
+ # Then take it!
+ contract.storage[msg.data[0]] = msg.data[1]
+ return(1)
+else:
+ return(0) // Otherwise do nothing
+ `)
+
+ fmt.Printf("%x\n", out)
+}