Skip to content
Snippets Groups Projects
Commit 618a12fc authored by Jono Wenger's avatar Jono Wenger
Browse files

Merge remote-tracking branch 'origin/release' into XX-4382/databaseInWorker2

parents 778d54f2 da13202c
Branches
Tags
2 merge requests!67fix for latest client release,!52XX-4382 / Move indexedDb databases to web workers
This commit is part of merge request !67. Comments created here will be created in the context of that merge request.
...@@ -14,6 +14,7 @@ before_script: ...@@ -14,6 +14,7 @@ before_script:
- git config --global url."git@$GITLAB_SERVER:".insteadOf "https://gitlab.com/" - git config --global url."git@$GITLAB_SERVER:".insteadOf "https://gitlab.com/"
- git config --global url."git@$GITLAB_SERVER:".insteadOf "https://git.xx.network/" --add - git config --global url."git@$GITLAB_SERVER:".insteadOf "https://git.xx.network/" --add
- export PATH=$HOME/go/bin:$PATH - export PATH=$HOME/go/bin:$PATH
- export GOPATH=$HOME/go/bin
stages: stages:
- test - test
...@@ -47,6 +48,13 @@ wasm-test: ...@@ -47,6 +48,13 @@ wasm-test:
script: script:
- export PATH=/root/go/bin:$PATH - export PATH=/root/go/bin:$PATH
- echo > utils/utils_js.s - echo > utils/utils_js.s
- env
# - go install github.com/agnivade/wasmbrowsertest@latest
# - mv ~/go/bin/go_js_wasm_exec ~/go/bin/go_js_wasm_exec.old
# - ln -s ~/go/bin/wasmbrowsertest ~/go/bin/go_js_wasm_exec
- go mod vendor
- unset SSH_PRIVATE_KEY
- unset $(env | grep '=' | awk -F= '{print $1}' | grep -v PATH | grep -v GO | grep -v HOME)
- GOOS=js GOARCH=wasm go test ./indexedDb/... -v - GOOS=js GOARCH=wasm go test ./indexedDb/... -v
- GOOS=js GOARCH=wasm go test ./... -v - GOOS=js GOARCH=wasm go test ./... -v
......
...@@ -7,61 +7,89 @@ require ( ...@@ -7,61 +7,89 @@ require (
github.com/hack-pad/go-indexeddb v0.2.0 github.com/hack-pad/go-indexeddb v0.2.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman v1.1.0
gitlab.com/elixxir/client/v4 v4.3.12-0.20230109185218-f0a828d928c2 gitlab.com/elixxir/client/v4 v4.3.12-0.20230110204625-5e87b36e0b21
gitlab.com/elixxir/crypto v0.0.7-0.20230109182503-bd51c95bdcb3 gitlab.com/elixxir/crypto v0.0.7-0.20230109232445-64f3e6192c3a
gitlab.com/elixxir/primitives v0.0.3-0.20221214192222-988b44a6958a gitlab.com/elixxir/primitives v0.0.3-0.20230109222259-f62b2a90b62c
gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46 gitlab.com/xx_network/crypto v0.0.5-0.20230109222209-557b66d73c33
gitlab.com/xx_network/primitives v0.0.4-0.20221219230308-4b5550a9247d gitlab.com/xx_network/primitives v0.0.4-0.20221219230308-4b5550a9247d
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa golang.org/x/crypto v0.5.0
) )
require ( require (
filippo.io/edwards25519 v1.0.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203224-436c7ab720af // indirect git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221204132-2ed1fec765f1 // indirect
github.com/agnivade/wasmbrowsertest v0.6.0 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/badoux/checkmail v1.2.1 // indirect github.com/badoux/checkmail v1.2.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/chromedp/cdproto v0.0.0-20221108233440-fad8339618ab // indirect
github.com/chromedp/chromedp v0.8.6 // indirect
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/cloudflare/circl v1.2.0 // indirect github.com/cloudflare/circl v1.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/elliotchance/orderedmap v1.4.0 // indirect github.com/elliotchance/orderedmap v1.4.0 // indirect
github.com/forPelevin/gomoji v1.1.8 // indirect github.com/forPelevin/gomoji v1.1.8 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-interpreter/wagon v0.6.0 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c // indirect
github.com/gorilla/websocket v1.5.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.11.7 // indirect github.com/klauspost/compress v1.11.7 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20221003100820-41fad3beba17 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20221003100820-41fad3beba17 // indirect
github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 // indirect github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/profile v1.6.0 // indirect
github.com/rivo/uniseg v0.4.3 // indirect github.com/rivo/uniseg v0.4.3 // indirect
github.com/rs/cors v1.8.2 // indirect github.com/rs/cors v1.8.2 // indirect
github.com/sethvargo/go-diceware v0.3.0 // indirect github.com/sethvargo/go-diceware v0.3.0 // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
github.com/soheilhy/cmux v0.1.5 // indirect github.com/soheilhy/cmux v0.1.5 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/subosito/gotenv v1.4.0 // indirect
github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect
github.com/ttacon/libphonenumber v1.2.1 // indirect github.com/ttacon/libphonenumber v1.2.1 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/zeebo/blake3 v0.2.3 // indirect github.com/zeebo/blake3 v0.2.3 // indirect
gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f // indirect gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f // indirect
gitlab.com/elixxir/comms v0.0.4-0.20230109184457-e10f20295430 // indirect gitlab.com/elixxir/comms v0.0.4-0.20230109233320-a0c90d3324a0 // indirect
gitlab.com/elixxir/ekv v0.2.1 // indirect gitlab.com/elixxir/ekv v0.2.1 // indirect
gitlab.com/xx_network/comms v0.0.4-0.20230109184153-4cb43814fa1d // indirect gitlab.com/xx_network/comms v0.0.4-0.20230109222246-7de292982747 // indirect
gitlab.com/xx_network/ring v0.0.3-0.20220902183151-a7d3b15bc981 // indirect gitlab.com/xx_network/ring v0.0.3-0.20220902183151-a7d3b15bc981 // indirect
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
gitlab.com/yawning/nyquist.git v0.0.0-20221003103146-de5645224a22 // indirect gitlab.com/yawning/nyquist.git v0.0.0-20221003103146-de5645224a22 // indirect
gitlab.com/yawning/x448.git v0.0.0-20221003101044-617eb9b7d9b7 // indirect gitlab.com/yawning/x448.git v0.0.0-20221003101044-617eb9b7d9b7 // indirect
go.uber.org/atomic v1.10.0 // indirect go.uber.org/atomic v1.10.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect golang.org/x/net v0.5.0 // indirect
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.3.7 // indirect golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
google.golang.org/grpc v1.49.0 // indirect google.golang.org/grpc v1.49.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.7 // indirect nhooyr.io/websocket v1.8.7 // indirect
src.agwa.name/tlshacks v0.0.0-20220518131152-d2c6f4e2b780 // indirect src.agwa.name/tlshacks v0.0.0-20220518131152-d2c6f4e2b780 // indirect
) )
This diff is collapsed.
...@@ -18,7 +18,7 @@ import ( ...@@ -18,7 +18,7 @@ import (
) )
// SEMVER is the current semantic version of xxDK WASM. // SEMVER is the current semantic version of xxDK WASM.
const SEMVER = "0.1.13" const SEMVER = "0.1.14"
// Storage keys. // Storage keys.
const ( const (
......
...@@ -635,9 +635,9 @@ func GetChannelInfo(_ js.Value, args []js.Value) any { ...@@ -635,9 +635,9 @@ func GetChannelInfo(_ js.Value, args []js.Value) any {
// 1 = private, and 2 = secret. Refer to the comment below for more // 1 = private, and 2 = secret. Refer to the comment below for more
// information. // information.
// //
// Returns: // Returns a promise:
// - The pretty print of the channel (string). // - Resolves to the pretty print of the channel (string).
// - Throws a TypeError if generating the channel fails. // - Rejected with an error if generating the channel fails.
// //
// The [broadcast.PrivacyLevel] of a channel indicates the level of channel // The [broadcast.PrivacyLevel] of a channel indicates the level of channel
// information revealed when sharing it via URL. For any channel besides public // information revealed when sharing it via URL. For any channel besides public
...@@ -649,14 +649,21 @@ func GetChannelInfo(_ js.Value, args []js.Value) any { ...@@ -649,14 +649,21 @@ func GetChannelInfo(_ js.Value, args []js.Value) any {
// description. // description.
// - A privacy level of [broadcast.Secret] reveals nothing. // - A privacy level of [broadcast.Secret] reveals nothing.
func (cm *ChannelsManager) GenerateChannel(_ js.Value, args []js.Value) any { func (cm *ChannelsManager) GenerateChannel(_ js.Value, args []js.Value) any {
prettyPrint, err := cm.api.GenerateChannel( name := args[0].String()
args[0].String(), args[1].String(), args[2].Int()) description := args[1].String()
privacyLevel := args[2].Int()
promiseFn := func(resolve, reject func(args ...any) js.Value) {
prettyPrint, err :=
cm.api.GenerateChannel(name, description, privacyLevel)
if err != nil { if err != nil {
utils.Throw(utils.TypeError, err) reject(utils.JsTrace(err))
return nil } else {
resolve(prettyPrint)
}
} }
return prettyPrint return utils.CreatePromise(promiseFn)
} }
// JoinChannel joins the given channel. It will return the error // JoinChannel joins the given channel. It will return the error
......
...@@ -83,19 +83,25 @@ func newCmixJS(api *bindings.Cmix) map[string]any { ...@@ -83,19 +83,25 @@ func newCmixJS(api *bindings.Cmix) map[string]any {
// - args[2] - Password used for storage (Uint8Array). // - args[2] - Password used for storage (Uint8Array).
// - args[3] - Registration code (string). // - args[3] - Registration code (string).
// //
// Returns: // Returns a promise:
// - Throws a TypeError if creating new [Cmix] fails. // - Resolves on success.
// - Rejected with an error if creating a new cMix client fails.
func NewCmix(_ js.Value, args []js.Value) any { func NewCmix(_ js.Value, args []js.Value) any {
ndfJSON := args[0].String()
storageDir := args[1].String()
password := utils.CopyBytesToGo(args[2]) password := utils.CopyBytesToGo(args[2])
registrationCode := args[3].String()
err := bindings.NewCmix( promiseFn := func(resolve, reject func(args ...any) js.Value) {
args[0].String(), args[1].String(), password, args[3].String()) err := bindings.NewCmix(ndfJSON, storageDir, password, registrationCode)
if err != nil { if err != nil {
utils.Throw(utils.TypeError, err) reject(utils.JsTrace(err))
return nil } else {
resolve()
}
} }
return nil return utils.CreatePromise(promiseFn)
} }
// LoadCmix will load an existing user storage from the storageDir using the // LoadCmix will load an existing user storage from the storageDir using the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment