aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/tools/patch_example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/tools/patch_example_test.go')
-rw-r--r--core/vm/tools/patch_example_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/vm/tools/patch_example_test.go b/core/vm/tools/patch_example_test.go
new file mode 100644
index 000000000..7c093e68f
--- /dev/null
+++ b/core/vm/tools/patch_example_test.go
@@ -0,0 +1,26 @@
+package tools
+
+import (
+ "fmt"
+)
+
+func ExamplePatchPUSH1() {
+ input := "606060405260068060106000396000f3606060405200"
+ // 07 ^00
+ fmt.Println(Patch(input))
+ // Output:
+ // 00606060405260078060106000396000f300606060405200
+}
+func ExamplePatchPUSH2() {
+ input := "6060604052aabb616fff8606060405200"
+ // 7000 ^00
+ fmt.Println(Patch(input))
+ // Output:
+ // 006060604052aabb616fff800606060405200
+}
+func ExamplePatchDelegate() {
+ input := "6504032353da71506060604052"
+ fmt.Println(Patch(input))
+ // Output:
+ // 006504032353da71506060604052
+}