From 43a3eea815324084d8a302730888856f60ff24e5 Mon Sep 17 00:00:00 2001 From: jbhusson <jonah@elixxir.io> Date: Tue, 30 May 2023 19:18:44 -0400 Subject: [PATCH] Fix naming on this side --- main.go | 4 ++-- wasm/channels.go | 10 +++++----- wasm_test.go | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 9bf2a059..60aa541c 100644 --- a/main.go +++ b/main.go @@ -136,8 +136,8 @@ func setGlobals() { js.FuncOf(wasm.GetNotificationReportsForMe)) js.Global().Set("GetNoMessageErr", js.FuncOf(wasm.GetNoMessageErr)) js.Global().Set("CheckNoMessageErr", js.FuncOf(wasm.CheckNoMessageErr)) - js.Global().Set("NewChannelsDatabaseCipher", - js.FuncOf(wasm.NewChannelsDatabaseCipher)) + js.Global().Set("NewDatabaseCipher", + js.FuncOf(wasm.NewDatabaseCipher)) js.Global().Set("GetNotificationReportsForMe", js.FuncOf(wasm.GetNotificationReportsForMe)) diff --git a/wasm/channels.go b/wasm/channels.go index 55833783..b1e27a21 100644 --- a/wasm/channels.go +++ b/wasm/channels.go @@ -370,7 +370,7 @@ func LoadChannelsManager(_ js.Value, args []js.Value) any { // various events. The entire interface can be nil, but if defined, each // method must be implemented. // - args[6] - ID of [DbCipher] object in tracker (int). Create this -// object with [NewChannelsDatabaseCipher] and get its id with +// object with [NewDatabaseCipher] and get its id with // [DbCipher.GetID]. // // Returns a promise: @@ -488,7 +488,7 @@ func newChannelsManagerWithIndexedDb(cmixID int, wasmJsPath string, // various events. The entire interface can be nil, but if defined, each // method must be implemented. // - args[6] - ID of [DbCipher] object in tracker (int). Create this -// object with [NewChannelsDatabaseCipher] and get its id with +// object with [NewDatabaseCipher] and get its id with // [DbCipher.GetID]. // // Returns a promise: @@ -2340,7 +2340,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any { return DbCipherMap } -// NewChannelsDatabaseCipher constructs a [DbCipher] object. +// NewDatabaseCipher constructs a [DbCipher] object. // // Parameters: // - args[0] - The tracked [Cmix] object ID (int). @@ -2353,7 +2353,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any { // Returns: // - JavaScript representation of the [DbCipher] object. // - Throws an error if creating the cipher fails. -func NewChannelsDatabaseCipher(_ js.Value, args []js.Value) any { +func NewDatabaseCipher(_ js.Value, args []js.Value) any { cmixId := args[0].Int() password := utils.CopyBytesToGo(args[1]) plaintTextBlockSize := args[2].Int() @@ -2382,7 +2382,7 @@ func (c *DbCipher) GetID(js.Value, []js.Value) any { // // Parameters: // - args[0] - The data to be encrypted (Uint8Array). This must be smaller -// than the block size passed into [NewChannelsDatabaseCipher]. If it is +// than the block size passed into [NewDatabaseCipher]. If it is // larger, this will return an error. // // Returns: diff --git a/wasm_test.go b/wasm_test.go index b415ece5..1e0494db 100644 --- a/wasm_test.go +++ b/wasm_test.go @@ -42,7 +42,7 @@ func TestPublicFunctions(t *testing.T) { "NewEventModel": {}, "NewChannelsManagerGoEventModel": {}, "LoadChannelsManagerGoEventModel": {}, - "GetChannelDbCipherTrackerFromID": {}, + "GetDbCipherTrackerFromID": {}, // Version functions were renamed to differentiate between WASM and // client versions -- GitLab