Skip to content

Commit

Permalink
Merge pull request #1673 from 0chain/feat/wasm-type
Browse files Browse the repository at this point in the history
Add method for wasm type
  • Loading branch information
dabasov authored Nov 14, 2024
2 parents 6304185 + 7be4ffe commit 06b30e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wasmsdk/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func main() {
"getLookupHash": getLookupHash,
"createThumbnail": createThumbnail,
"makeSCRestAPICall": makeSCRestAPICall,
"wasmType": getWasmType,

//blobber
"delete": Delete,
Expand Down Expand Up @@ -332,6 +333,7 @@ func main() {

fmt.Println("__wasm_initialized__ = true;")
zcn.Set("__wasm_initialized__", true)
zcn.Set("wasmType", "normal")
} else {
PrintError("__zcn_wasm__.sdk is not installed yet")
}
Expand Down
5 changes: 5 additions & 0 deletions wasmsdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"

"github.com/0chain/gosdk/core/client"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/imageutil"
Expand Down Expand Up @@ -54,6 +55,10 @@ func getVersion() string {
return sdk.GetVersion()
}

func getWasmType() string {
return "normal"
}

var sdkLogger *logger.Logger
var zcnLogger *logger.Logger
var logEnabled = false
Expand Down

0 comments on commit 06b30e2

Please sign in to comment.