Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
43a3eea8
Commit
43a3eea8
authored
1 year ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Fix naming on this side
parent
1087ef9b
No related branches found
No related tags found
3 merge requests
!128
Project/base32768
,
!124
Update for single DB cipher object
,
!109
Project/haven beta
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.go
+2
-2
2 additions, 2 deletions
main.go
wasm/channels.go
+5
-5
5 additions, 5 deletions
wasm/channels.go
wasm_test.go
+1
-1
1 addition, 1 deletion
wasm_test.go
with
8 additions
and
8 deletions
main.go
+
2
−
2
View file @
43a3eea8
...
@@ -136,8 +136,8 @@ func setGlobals() {
...
@@ -136,8 +136,8 @@ func setGlobals() {
js
.
FuncOf
(
wasm
.
GetNotificationReportsForMe
))
js
.
FuncOf
(
wasm
.
GetNotificationReportsForMe
))
js
.
Global
()
.
Set
(
"GetNoMessageErr"
,
js
.
FuncOf
(
wasm
.
GetNoMessageErr
))
js
.
Global
()
.
Set
(
"GetNoMessageErr"
,
js
.
FuncOf
(
wasm
.
GetNoMessageErr
))
js
.
Global
()
.
Set
(
"CheckNoMessageErr"
,
js
.
FuncOf
(
wasm
.
CheckNoMessageErr
))
js
.
Global
()
.
Set
(
"CheckNoMessageErr"
,
js
.
FuncOf
(
wasm
.
CheckNoMessageErr
))
js
.
Global
()
.
Set
(
"New
Channels
DatabaseCipher"
,
js
.
Global
()
.
Set
(
"NewDatabaseCipher"
,
js
.
FuncOf
(
wasm
.
New
Channels
DatabaseCipher
))
js
.
FuncOf
(
wasm
.
NewDatabaseCipher
))
js
.
Global
()
.
Set
(
"GetNotificationReportsForMe"
,
js
.
Global
()
.
Set
(
"GetNotificationReportsForMe"
,
js
.
FuncOf
(
wasm
.
GetNotificationReportsForMe
))
js
.
FuncOf
(
wasm
.
GetNotificationReportsForMe
))
...
...
This diff is collapsed.
Click to expand it.
wasm/channels.go
+
5
−
5
View file @
43a3eea8
...
@@ -370,7 +370,7 @@ func LoadChannelsManager(_ js.Value, args []js.Value) any {
...
@@ -370,7 +370,7 @@ func LoadChannelsManager(_ js.Value, args []js.Value) any {
// various events. The entire interface can be nil, but if defined, each
// various events. The entire interface can be nil, but if defined, each
// method must be implemented.
// method must be implemented.
// - args[6] - ID of [DbCipher] object in tracker (int). Create this
// - args[6] - ID of [DbCipher] object in tracker (int). Create this
// object with [New
Channels
DatabaseCipher] and get its id with
// object with [NewDatabaseCipher] and get its id with
// [DbCipher.GetID].
// [DbCipher.GetID].
//
//
// Returns a promise:
// Returns a promise:
...
@@ -488,7 +488,7 @@ func newChannelsManagerWithIndexedDb(cmixID int, wasmJsPath string,
...
@@ -488,7 +488,7 @@ func newChannelsManagerWithIndexedDb(cmixID int, wasmJsPath string,
// various events. The entire interface can be nil, but if defined, each
// various events. The entire interface can be nil, but if defined, each
// method must be implemented.
// method must be implemented.
// - args[6] - ID of [DbCipher] object in tracker (int). Create this
// - args[6] - ID of [DbCipher] object in tracker (int). Create this
// object with [New
Channels
DatabaseCipher] and get its id with
// object with [NewDatabaseCipher] and get its id with
// [DbCipher.GetID].
// [DbCipher.GetID].
//
//
// Returns a promise:
// Returns a promise:
...
@@ -2340,7 +2340,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any {
...
@@ -2340,7 +2340,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any {
return
DbCipherMap
return
DbCipherMap
}
}
// New
Channels
DatabaseCipher constructs a [DbCipher] object.
// NewDatabaseCipher constructs a [DbCipher] object.
//
//
// Parameters:
// Parameters:
// - args[0] - The tracked [Cmix] object ID (int).
// - args[0] - The tracked [Cmix] object ID (int).
...
@@ -2353,7 +2353,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any {
...
@@ -2353,7 +2353,7 @@ func newDbCipherJS(api *bindings.DbCipher) map[string]any {
// Returns:
// Returns:
// - JavaScript representation of the [DbCipher] object.
// - JavaScript representation of the [DbCipher] object.
// - Throws an error if creating the cipher fails.
// - Throws an error if creating the cipher fails.
func
New
Channels
DatabaseCipher
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
func
NewDatabaseCipher
(
_
js
.
Value
,
args
[]
js
.
Value
)
any
{
cmixId
:=
args
[
0
]
.
Int
()
cmixId
:=
args
[
0
]
.
Int
()
password
:=
utils
.
CopyBytesToGo
(
args
[
1
])
password
:=
utils
.
CopyBytesToGo
(
args
[
1
])
plaintTextBlockSize
:=
args
[
2
]
.
Int
()
plaintTextBlockSize
:=
args
[
2
]
.
Int
()
...
@@ -2382,7 +2382,7 @@ func (c *DbCipher) GetID(js.Value, []js.Value) any {
...
@@ -2382,7 +2382,7 @@ func (c *DbCipher) GetID(js.Value, []js.Value) any {
//
//
// Parameters:
// Parameters:
// - args[0] - The data to be encrypted (Uint8Array). This must be smaller
// - args[0] - The data to be encrypted (Uint8Array). This must be smaller
// than the block size passed into [New
Channels
DatabaseCipher]. If it is
// than the block size passed into [NewDatabaseCipher]. If it is
// larger, this will return an error.
// larger, this will return an error.
//
//
// Returns:
// Returns:
...
...
This diff is collapsed.
Click to expand it.
wasm_test.go
+
1
−
1
View file @
43a3eea8
...
@@ -42,7 +42,7 @@ func TestPublicFunctions(t *testing.T) {
...
@@ -42,7 +42,7 @@ func TestPublicFunctions(t *testing.T) {
"NewEventModel"
:
{},
"NewEventModel"
:
{},
"NewChannelsManagerGoEventModel"
:
{},
"NewChannelsManagerGoEventModel"
:
{},
"LoadChannelsManagerGoEventModel"
:
{},
"LoadChannelsManagerGoEventModel"
:
{},
"Get
Channel
DbCipherTrackerFromID"
:
{},
"GetDbCipherTrackerFromID"
:
{},
// Version functions were renamed to differentiate between WASM and
// Version functions were renamed to differentiate between WASM and
// client versions
// client versions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment