Skip to content

Commit

Permalink
Is different value decorator fix (#80)
Browse files Browse the repository at this point in the history
* update decorator to fix erroneous error throws
* update all versions
* restore manifest
  • Loading branch information
befitsandpiper authored Mar 5, 2024
1 parent e4aa826 commit a6e1a52
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 39 deletions.
2 changes: 1 addition & 1 deletion chain-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/api",
"version": "1.0.17",
"version": "1.0.18",
"description": "Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.",
"license": "Apache-2.0",
"dependencies": {
Expand Down
7 changes: 5 additions & 2 deletions chain-api/src/validators/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ export function IsDifferentValue(property: string, validationOptions?: Validatio
validate(value: Record<string, unknown>, args: ValidationArguments) {
const [relatedPropertyName] = args.constraints;
const relatedValue = args.object[relatedPropertyName];
if (typeof value !== "object" || typeof relatedValue !== "object") {
throw new NotImplementedError("IsDifferentValue only works with plain objects");
if (
(typeof value !== "string" && value !== undefined) ||
(typeof relatedValue !== "string" && relatedValue !== undefined)
) {
throw new NotImplementedError("IsDifferentValue only works with string or undefined");
}
return value !== relatedValue;
}
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @gala-chain/cli
$ galachain COMMAND
running command...
$ galachain (--version)
@gala-chain/cli/1.0.17 linux-x64 node-v16.16.0
@gala-chain/cli/1.0.18 linux-x64 node-v16.16.0
$ galachain --help [COMMAND]
USAGE
$ galachain COMMAND
Expand Down
12 changes: 6 additions & 6 deletions chain-cli/chaincode-template/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galachain/product",
"version": "1.0.17",
"version": "1.0.18",
"description": "Product Chaincode",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
Expand All @@ -22,16 +22,16 @@
"update-snapshot": "jest --updateSnapshot"
},
"dependencies": {
"@gala-chain/api": "1.0.17",
"@gala-chain/chaincode": "1.0.17",
"@gala-chain/api": "1.0.18",
"@gala-chain/chaincode": "1.0.18",
"dotenv": "^16.0.1",
"fabric-contract-api": "2.4.2",
"fabric-shim": "2.4.2"
},
"devDependencies": {
"@gala-chain/cli": "1.0.17",
"@gala-chain/client": "1.0.17",
"@gala-chain/test": "1.0.17",
"@gala-chain/cli": "1.0.18",
"@gala-chain/client": "1.0.18",
"@gala-chain/test": "1.0.18",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/axios": "^0.14.0",
"@types/jest": "^29.5.12",
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/oclif.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.17",
"version": "1.0.18",
"commands": {
"connect": {
"id": "connect",
Expand Down
4 changes: 2 additions & 2 deletions chain-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/cli",
"version": "1.0.17",
"version": "1.0.18",
"description": "CLI for GalaChain to manage and deploy chaincodes",
"license": "Apache-2.0",
"bin": {
Expand All @@ -14,7 +14,7 @@
"/oclif.manifest.json"
],
"dependencies": {
"@gala-chain/api": "1.0.17",
"@gala-chain/api": "1.0.18",
"@noble/secp256k1": "^1.7.1",
"@oclif/core": "^2",
"@oclif/plugin-help": "^2",
Expand Down
4 changes: 2 additions & 2 deletions chain-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/client",
"version": "1.0.17",
"version": "1.0.18",
"description": "GalaChain client library",
"license": "Apache-2.0",
"scripts": {
Expand All @@ -21,7 +21,7 @@
"lib"
],
"dependencies": {
"@gala-chain/api": "1.0.17",
"@gala-chain/api": "1.0.18",
"axios": "^1.6.0",
"jsonschema": "^1.4.1",
"tslib": "^2.6.2",
Expand Down
6 changes: 3 additions & 3 deletions chain-test/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@gala-chain/test",
"version": "1.0.17",
"version": "1.0.18",
"description": "Unit testing and integration testing for GalaChain",
"license": "Apache-2.0",
"dependencies": {
"@gala-chain/client": "1.0.17",
"@gala-chain/client": "1.0.18",
"nanoid": "^3.3.6",
"tslib": "^2.6.2",
"path": "0.12.7",
"process": "0.11.10",
"@jest/globals": "29.7.0"
},
"peerDependencies": {
"@gala-chain/api": "1.0.17",
"@gala-chain/api": "1.0.18",
"bignumber.js": "*",
"class-transformer": "*",
"elliptic": "*",
Expand Down
4 changes: 2 additions & 2 deletions chaincode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/chaincode",
"version": "1.0.17",
"version": "1.0.18",
"description": "Framework for building chaincodes on GalaChain",
"license": "Apache-2.0",
"type": "commonjs",
Expand All @@ -21,7 +21,7 @@
"test": "jest"
},
"dependencies": {
"@gala-chain/api": "1.0.17",
"@gala-chain/api": "1.0.18",
"fabric-contract-api": "2.4.2",
"fabric-shim": "2.4.2",
"nanoid": "^3.3.6",
Expand Down
12 changes: 6 additions & 6 deletions licenses/licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@
"@eslint/[email protected]","@eslint/js","8.55.0","https://github.com/eslint/eslint","ESLint JavaScript language implementation","MIT"
"@fidm/[email protected]","@fidm/asn1","1.0.4","https://github.com/fidm/asn1","ASN.1/DER, PEM for Node.js","MIT"
"@fidm/[email protected]","@fidm/x509","1.2.1","https://github.com/fidm/x509","Pure JavaScript X509 certificate tools for Node.js","MIT"
"@gala-chain/[email protected].17","@gala-chain/api","1.0.17","","Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.","Apache-2.0"
"@gala-chain/[email protected].17","@gala-chain/chaincode","1.0.17","","Framework for building chaincodes on GalaChain","Apache-2.0"
"@gala-chain/[email protected].17","@gala-chain/cli","1.0.17","","CLI for GalaChain to manage and deploy chaincodes","Apache-2.0"
"@gala-chain/[email protected].17","@gala-chain/client","1.0.17","","GalaChain client library","Apache-2.0"
"@gala-chain/[email protected].17","@gala-chain/sdk","1.0.17","","Welcome to developing with GalaChain! GalaChain SDK is a set of TS tools to help you develop on GalaChain:","UNLICENSED"
"@gala-chain/[email protected].17","@gala-chain/test","1.0.17","","Unit testing and integration testing for GalaChain","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/api","1.0.18","","Common types, DTOs (Data Transfer Objects), APIs, signatures, and utils for GalaChain.","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/chaincode","1.0.18","","Framework for building chaincodes on GalaChain","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/cli","1.0.18","","CLI for GalaChain to manage and deploy chaincodes","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/client","1.0.18","","GalaChain client library","Apache-2.0"
"@gala-chain/[email protected].18","@gala-chain/sdk","1.0.18","","Welcome to developing with GalaChain! GalaChain SDK is a set of TS tools to help you develop on GalaChain:","UNLICENSED"
"@gala-chain/[email protected].18","@gala-chain/test","1.0.18","","Unit testing and integration testing for GalaChain","Apache-2.0"
"@gar/[email protected]","@gar/promisify","1.1.3","https://github.com/wraithgar/gar-promisify","Promisify an entire class or object","MIT"
"@grpc/[email protected]","@grpc/grpc-js","1.9.7","https://github.com/grpc/grpc-node/tree/master/packages/grpc-js","gRPC Library for Node - pure JS implementation","Apache-2.0"
"@grpc/[email protected]","@grpc/proto-loader","0.6.13","https://github.com/grpc/grpc-node","gRPC utility library for loading .proto files","Apache-2.0"
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gala-chain/sdk",
"version": "1.0.17",
"version": "1.0.18",
"license": "Apache-2.0",
"scripts": {
"lint": "nx run-many -t lint",
Expand Down

0 comments on commit a6e1a52

Please sign in to comment.