From d228bde2bae6b71066ddbb822787f66657c05cc2 Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Wed, 19 Oct 2022 15:16:44 -0700 Subject: [PATCH] Rename client version functions and make GetVersion return the current xxDK WASM version --- main.go | 5 +++-- wasm/version.go | 26 +++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index c4f89dd5..06bbe723 100644 --- a/main.go +++ b/main.go @@ -170,8 +170,9 @@ func main() { // wasm/version.go js.Global().Set("GetVersion", js.FuncOf(wasm.GetVersion)) - js.Global().Set("GetGitVersion", js.FuncOf(wasm.GetGitVersion)) - js.Global().Set("GetDependencies", js.FuncOf(wasm.GetDependencies)) + js.Global().Set("GetClientVersion", js.FuncOf(wasm.GetClientVersion)) + js.Global().Set("GetClientGitVersion", js.FuncOf(wasm.GetClientGitVersion)) + js.Global().Set("GetClientDependencies", js.FuncOf(wasm.GetClientDependencies)) <-make(chan bool) os.Exit(0) diff --git a/wasm/version.go b/wasm/version.go index 3ae5b522..0ffab9a2 100644 --- a/wasm/version.go +++ b/wasm/version.go @@ -11,29 +11,41 @@ package wasm import ( "gitlab.com/elixxir/client/bindings" + "gitlab.com/elixxir/xxdk-wasm/utils" "syscall/js" ) -// GetVersion returns the [xxdk.SEMVER]. +// GetVersion returns the current xxDK WASM semantic version. // // Returns: -// - Version (string). +// - Current version (string). func GetVersion(js.Value, []js.Value) interface{} { + return utils.SEMVER +} + +// GetClientVersion returns the current client xxDK semantic version +// ([xxdk.SEMVER]). +// +// Returns: +// - Current version (string). +func GetClientVersion(js.Value, []js.Value) interface{} { return bindings.GetVersion() } -// GetGitVersion returns the [xxdk.GITVERSION]. +// GetClientGitVersion returns the current client xxDK git version +// ([xxdk.GITVERSION]). // // Returns: // - Git version (string). -func GetGitVersion(js.Value, []js.Value) interface{} { +func GetClientGitVersion(js.Value, []js.Value) interface{} { return bindings.GetGitVersion() } -// GetDependencies returns the [xxdk.DEPENDENCIES]. +// GetClientDependencies returns the client's dependencies +// ([xxdk.DEPENDENCIES]). // // Returns: -// - Git dependencies (string). -func GetDependencies(js.Value, []js.Value) interface{} { +// - Dependency list (string). +func GetClientDependencies(js.Value, []js.Value) interface{} { return bindings.GetDependencies() } -- GitLab