Merge pull request #4119 from nymtech/tommy/publish-sdk-candidate
Update SDK - version bump to 1.2.4-rc.1
This commit is contained in:
Generated
+4
-4
@@ -2994,7 +2994,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "extension-storage"
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
dependencies = [
|
||||
"bip39",
|
||||
"console_error_panic_hook",
|
||||
@@ -5559,7 +5559,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mix-fetch-wasm"
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures",
|
||||
@@ -6261,7 +6261,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-client-wasm"
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"futures",
|
||||
@@ -6960,7 +6960,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-node-tester-wasm"
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"js-sys",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "extension-storage"
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
repository = "https://github.com/nymtech/nym"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/nym-wallet-app",
|
||||
"version": "1.2.12-rc.0",
|
||||
"version": "1.2.12-rc.1",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/contract-clients",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"description": "A client for all Nym smart contracts",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/ts-sdk-docs",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"description": "Nym Typescript SDK Docs",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
@@ -28,9 +28,9 @@
|
||||
"@mui/icons-material": "^5.14.9",
|
||||
"@mui/lab": "^5.0.0-alpha.145",
|
||||
"@mui/material": "^5.14.8",
|
||||
"@nymproject/contract-clients": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/mix-fetch-full-fat": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/sdk-full-fat": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/contract-clients": ">=1.2.4-rc.1 || ^1",
|
||||
"@nymproject/mix-fetch-full-fat": ">=1.2.4-rc.1 || ^1",
|
||||
"@nymproject/sdk-full-fat": ">=1.2.4-rc.1 || ^1",
|
||||
"chain-registry": "^1.19.0",
|
||||
"cosmjs-types": "^0.8.0",
|
||||
"next": "^13.4.19",
|
||||
@@ -50,4 +50,4 @@
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
"private": false
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-plain-html-parcel",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM and plain HTML bundled with Parcel v2",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-plain-html",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM and plain HTML",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-react-webpack-wasm",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM, React, Webpack, Typescript and the Nym theme + components library",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-chrome-extension",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "This is an example of how Nym can be used within the context of a Chrome extension.",
|
||||
"license": "ISC",
|
||||
"author": "",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-firefox-extension",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "This is an example of how Nym can be used within the context of a Firefox extension.",
|
||||
"license": "ISC",
|
||||
"author": "",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/mix-fetch-example-parcel",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "parcel build --no-cache --no-content-hash",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-node-tester-plain-html-parcel",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM and plain HTML bundled with Parcel v2",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-node-tester-plain-html",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM node tester and plain HTML",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-example-node-tester-react",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"description": "An example project that uses WASM node tester and React",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/mix-fetch-node",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"description": "This package is a drop-in replacement for `fetch` in NodeJS to send HTTP requests over the Nym Mixnet.",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
@@ -28,7 +28,7 @@
|
||||
"tsc": "tsc --noEmit true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nymproject/mix-fetch-wasm-node": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/mix-fetch-wasm-node": ">=1.2.4-rc.1 || ^1",
|
||||
"comlink": "^4.3.1",
|
||||
"fake-indexeddb": "^5.0.0",
|
||||
"node-fetch": "^3.3.2",
|
||||
@@ -68,4 +68,4 @@
|
||||
},
|
||||
"private": false,
|
||||
"types": "./dist/cjs/index.d.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/mix-fetch-tester-webpack",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "webpack build --progress --config webpack.prod.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/mix-fetch-tester-parcel",
|
||||
"version": "1.0.4-rc.0",
|
||||
"version": "1.0.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "npx parcel build --no-cache --no-content-hash",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/mix-fetch",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"description": "This package is a drop-in replacement for `fetch` to send HTTP requests over the Nym Mixnet.",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
@@ -34,7 +34,7 @@
|
||||
"tsc": "tsc --noEmit true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nymproject/mix-fetch-wasm": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/mix-fetch-wasm": ">=1.2.4-rc.1 || ^1",
|
||||
"comlink": "^4.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -82,4 +82,4 @@
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"types": "./dist/esm/index.d.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/node-tester",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"description": "This package provides a tester that can send test packets to mixnode that is part of the Nym Mixnet.",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
@@ -25,7 +25,7 @@
|
||||
"tsc": "tsc --noEmit true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nymproject/nym-node-tester-wasm": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/nym-node-tester-wasm": ">=1.2.4-rc.1 || ^1",
|
||||
"comlink": "^4.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -71,4 +71,4 @@
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"types": "./dist/esm/index.d.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/nodejs-client",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
"files": [
|
||||
@@ -25,7 +25,7 @@
|
||||
"tsc": "tsc --noEmit true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nymproject/nym-client-wasm-node": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/nym-client-wasm-node": ">=1.2.4-rc.1 || ^1",
|
||||
"comlink": "^4.3.1",
|
||||
"fake-indexeddb": "^4.0.2",
|
||||
"rollup-plugin-polyfill": "^4.2.0",
|
||||
@@ -66,4 +66,4 @@
|
||||
},
|
||||
"private": false,
|
||||
"types": "./dist/index.d.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk-react",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
"files": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@nymproject/sdk",
|
||||
"version": "1.2.4-rc.0",
|
||||
"version": "1.2.4-rc.1",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
"files": [
|
||||
@@ -31,7 +31,7 @@
|
||||
"tsc": "tsc --noEmit true"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nymproject/nym-client-wasm": ">=1.2.4-rc.0 || ^1",
|
||||
"@nymproject/nym-client-wasm": ">=1.2.4-rc.1 || ^1",
|
||||
"comlink": "^4.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -81,4 +81,4 @@
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"types": "./dist/esm/index.d.ts"
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "nym-client-wasm"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jedrzej Stuczynski <andrew@nymtech.net>"]
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
edition = "2021"
|
||||
keywords = ["nym", "sphinx", "wasm", "webassembly", "privacy", "client"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use anyhow::bail;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use anyhow::bail;
|
||||
|
||||
#[wasm_bindgen(typescript_custom_section)]
|
||||
const TS_DEFS: &'static str = r#"
|
||||
@@ -94,9 +94,11 @@ pub(crate) fn parse_payload(message: &[u8]) -> anyhow::Result<(EncodedPayloadMet
|
||||
let metadata_size = u64::from_be_bytes(size) as usize;
|
||||
|
||||
if metadata_size + 8 != message.len() {
|
||||
return Err(anyhow::anyhow!(
|
||||
format!("Metadata size: {}, exceeds message with length of: {}", metadata_size, message.len()),
|
||||
));
|
||||
return Err(anyhow::anyhow!(format!(
|
||||
"Metadata size: {}, exceeds message with length of: {}",
|
||||
metadata_size,
|
||||
message.len()
|
||||
),));
|
||||
}
|
||||
|
||||
//then the metadata
|
||||
@@ -247,23 +249,29 @@ mod tests {
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
async fn test_parse_payload_too_short() {
|
||||
let message = vec![0u8; 7];
|
||||
let message = vec![0u8; 7];
|
||||
let result = parse_payload(&message);
|
||||
assert!(result.is_err());
|
||||
let error = result.unwrap_err();
|
||||
assert_eq!(error.to_string(), "Message is too short to contain size information");
|
||||
assert_eq!(
|
||||
error.to_string(),
|
||||
"Message is too short to contain size information"
|
||||
);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
async fn test_parse_payload_size_exceeds_length() {
|
||||
let mut message = vec![0u8; 8];
|
||||
message.extend(vec![1u8; 10]);
|
||||
message[0..8].copy_from_slice(&(20u64.to_be_bytes()));
|
||||
|
||||
let mut message = vec![0u8; 8];
|
||||
message.extend(vec![1u8; 10]);
|
||||
message[0..8].copy_from_slice(&(20u64.to_be_bytes()));
|
||||
|
||||
let result = parse_payload(&message);
|
||||
assert!(result.is_err());
|
||||
let error = result.unwrap_err();
|
||||
assert_eq!(error.to_string(), "Metadata size: 20, exceeds message with length of: 18");
|
||||
assert_eq!(
|
||||
error.to_string(),
|
||||
"Metadata size: 20, exceeds message with length of: 18"
|
||||
);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
@@ -272,7 +280,7 @@ mod tests {
|
||||
mime_type: "text/plain".to_string(),
|
||||
headers: Some("test headers".to_string()),
|
||||
};
|
||||
let payload_data = vec![2u8, 3u8, 5u8];
|
||||
let payload_data = vec![2u8, 3u8, 5u8];
|
||||
|
||||
let serialized_metadata = serde_json::to_string(&metadata).unwrap();
|
||||
let metadata_length = serialized_metadata.len() as u64;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "mix-fetch-wasm"
|
||||
authors = ["Jedrzej Stuczynski <andrew@nymtech.net>"]
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
edition = "2021"
|
||||
keywords = ["nym", "fetch", "wasm", "webassembly", "privacy"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "nym-node-tester-wasm"
|
||||
authors = ["Jedrzej Stuczynski <andrew@nymtech.net>"]
|
||||
version = "1.2.4-rc.0"
|
||||
version = "1.2.4-rc.1"
|
||||
edition = "2021"
|
||||
keywords = ["nym", "sphinx", "webassembly", "privacy", "tester"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
Reference in New Issue
Block a user