Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 831d6f5

Browse files
committed
feat: Go wasm - refactor
1 parent 6192127 commit 831d6f5

File tree

25 files changed

+185
-334
lines changed

25 files changed

+185
-334
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ pkg
116116
build
117117

118118
# go build folder
119-
out/*.wasm
119+
.out

go/build-tiny.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
tinygo build -o out/contract_tiny.wasm -no-debug -target wasm main.go
1+
mkdir -p .out
2+
tinygo build -o .out/contract_tiny.wasm -no-debug -target wasm main.go

go/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# tinygo build -o out/impl.wasm -target wasm impl.go
2-
GOOS=js GOARCH=wasm go build -o out/contract.wasm main.go
1+
mkdir -p .out
2+
GOOS=js GOARCH=wasm go build -o .out/contract.wasm main.go

go/common/async.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,3 @@ func Await(awaitable js.Value) ([]js.Value, []js.Value) {
3030
return nil, err
3131
}
3232
}
33-
34-
func DeepCopy(src, dest interface{}) (err error) {
35-
dest = &src
36-
return nil
37-
/*buf := bytes.Buffer{}
38-
if err = gob.NewEncoder(&buf).Encode(src); err != nil {
39-
return
40-
}
41-
return gob.NewDecoder(&buf).Decode(dest)*/
42-
}
File renamed without changes.
File renamed without changes.

go/common_types/types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package common_types
2+
3+
type Action struct {
4+
Function string `json:"function"`
5+
}
6+
7+
type ActionResult = interface{}
8+
9+
//easyjson:skip
10+
type SwContract interface {
11+
}

0 commit comments

Comments
 (0)