@ocap/state 1.29.13 → 1.29.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  import { StateContextInput } from "../contexts/state.mjs";
2
2
  import { schemas } from "@arcblock/validator";
3
3
  import { IAssetState } from "@ocap/types";
4
- import * as joi1 from "joi";
4
+ import * as joi0 from "joi";
5
5
 
6
6
  //#region src/states/asset.d.ts
7
7
  declare namespace asset_d_exports {
8
8
  export { create, schema, schemas, update, validate };
9
9
  }
10
- declare const schema: joi1.ObjectSchema<any>;
10
+ declare const schema: joi0.ObjectSchema<any>;
11
11
  declare const create: (attrs: Partial<IAssetState>, context: StateContextInput) => IAssetState;
12
12
  declare const update: (state: IAssetState, attrs: Partial<IAssetState>, context: StateContextInput) => IAssetState;
13
13
  declare const validate: (state: IAssetState) => IAssetState;
@@ -17,10 +17,14 @@ const create = (attrs, context) => {
17
17
  "to",
18
18
  "from",
19
19
  "ops",
20
+ "deny",
21
+ "validUntil",
20
22
  "data"
21
23
  ])
22
24
  };
23
25
  if (!delegation.data) delegation.data = null;
26
+ if (!delegation.deny) delegation.deny = [];
27
+ if (!delegation.validUntil) delegation.validUntil = 0;
24
28
  delegation.address = toAddress(delegation.address);
25
29
  delegation.ops = nullify(delegation.ops);
26
30
  return delegation;
@@ -28,7 +32,12 @@ const create = (attrs, context) => {
28
32
  const update = (state, attrs, context) => {
29
33
  const delegation = {
30
34
  ...state,
31
- ...pick(attrs, ["ops", "data"]),
35
+ ...pick(attrs, [
36
+ "ops",
37
+ "deny",
38
+ "validUntil",
39
+ "data"
40
+ ]),
32
41
  context: update$1(state.context, context)
33
42
  };
34
43
  if (!delegation.data) delegation.data = null;
@@ -1,12 +1,12 @@
1
1
  import { StateContextInput } from "../contexts/state.mjs";
2
2
  import { IEvidenceState } from "@ocap/types";
3
- import * as joi2 from "joi";
3
+ import * as joi1 from "joi";
4
4
 
5
5
  //#region src/states/evidence.d.ts
6
6
  declare namespace evidence_d_exports {
7
7
  export { create, schema, validate };
8
8
  }
9
- declare const schema: joi2.ObjectSchema<any>;
9
+ declare const schema: joi1.ObjectSchema<any>;
10
10
  declare const create: (attrs: Partial<IEvidenceState>, context: StateContextInput) => IEvidenceState;
11
11
  declare const validate: (state: IEvidenceState) => IEvidenceState;
12
12
  //#endregion
@@ -1,12 +1,12 @@
1
1
  import { StateContextInput } from "../contexts/state.mjs";
2
2
  import { IRollupBlock } from "@ocap/types";
3
- import * as joi0 from "joi";
3
+ import * as joi2 from "joi";
4
4
 
5
5
  //#region src/states/rollup-block.d.ts
6
6
  declare namespace rollup_block_d_exports {
7
7
  export { create, schema, update, validate };
8
8
  }
9
- declare const schema: joi0.ObjectSchema<any>;
9
+ declare const schema: joi2.ObjectSchema<any>;
10
10
  declare const create: (attrs: Partial<IRollupBlock>, context: StateContextInput) => IRollupBlock;
11
11
  declare const update: (state: IRollupBlock, context: StateContextInput) => IRollupBlock;
12
12
  declare const validate: (state: IRollupBlock) => IRollupBlock;
@@ -1,12 +1,12 @@
1
1
  import { StateContextInput } from "../contexts/state.mjs";
2
2
  import { IRollupState } from "@ocap/types";
3
- import * as joi4 from "joi";
3
+ import * as joi3 from "joi";
4
4
 
5
5
  //#region src/states/rollup.d.ts
6
6
  declare namespace rollup_d_exports {
7
7
  export { close, create, migrateContract, migrateVault, pause, resume, schema, update, validate };
8
8
  }
9
- declare const schema: joi4.ObjectSchema<any>;
9
+ declare const schema: joi3.ObjectSchema<any>;
10
10
  declare const create: (attrs: Partial<IRollupState>, context: StateContextInput) => IRollupState;
11
11
  declare const update: (state: IRollupState, updates: Partial<IRollupState>, context: StateContextInput) => IRollupState;
12
12
  declare const pause: (state: IRollupState, context: StateContextInput) => IRollupState;
@@ -1,12 +1,12 @@
1
1
  import { StateContextInput } from "../contexts/state.mjs";
2
2
  import { IStakeState } from "@ocap/types";
3
- import * as joi3 from "joi";
3
+ import * as joi4 from "joi";
4
4
 
5
5
  //#region src/states/stake.d.ts
6
6
  declare namespace stake_d_exports {
7
7
  export { create, schema, update, validate };
8
8
  }
9
- declare const schema: joi3.ObjectSchema<any>;
9
+ declare const schema: joi4.ObjectSchema<any>;
10
10
  declare const create: (attrs: Partial<IStakeState>, context: StateContextInput) => IStakeState;
11
11
  declare const update: (state: IStakeState, attrs: Partial<IStakeState>, context: StateContextInput) => IStakeState;
12
12
  declare const validate: (state: IStakeState) => IStakeState;
@@ -18,10 +18,14 @@ const create = (attrs, context) => {
18
18
  "to",
19
19
  "from",
20
20
  "ops",
21
+ "deny",
22
+ "validUntil",
21
23
  "data"
22
24
  ])
23
25
  };
24
26
  if (!delegation.data) delegation.data = null;
27
+ if (!delegation.deny) delegation.deny = [];
28
+ if (!delegation.validUntil) delegation.validUntil = 0;
25
29
  delegation.address = (0, _ocap_util.toAddress)(delegation.address);
26
30
  delegation.ops = require_util.nullify(delegation.ops);
27
31
  return delegation;
@@ -29,7 +33,12 @@ const create = (attrs, context) => {
29
33
  const update = (state, attrs, context) => {
30
34
  const delegation = {
31
35
  ...state,
32
- ...(0, lodash_pick.default)(attrs, ["ops", "data"]),
36
+ ...(0, lodash_pick.default)(attrs, [
37
+ "ops",
38
+ "deny",
39
+ "validUntil",
40
+ "data"
41
+ ]),
33
42
  context: require_contexts_state.update(state.context, context)
34
43
  };
35
44
  if (!delegation.data) delegation.data = null;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.29.13",
6
+ "version": "1.29.15",
7
7
  "description": "State management utilities for OCAP blockchain",
8
8
  "type": "module",
9
9
  "main": "./lib/index.cjs",
@@ -40,14 +40,14 @@
40
40
  "clean": "rm -rf lib esm"
41
41
  },
42
42
  "dependencies": {
43
- "@arcblock/did": "1.29.13",
44
- "@arcblock/validator": "1.29.13",
45
- "@ocap/contract": "1.29.13",
46
- "@ocap/mcrypto": "1.29.13",
47
- "@ocap/message": "1.29.13",
48
- "@ocap/types": "1.29.13",
49
- "@ocap/util": "1.29.13",
50
- "@ocap/wallet": "1.29.13",
43
+ "@arcblock/did": "1.29.15",
44
+ "@arcblock/validator": "1.29.15",
45
+ "@ocap/contract": "1.29.15",
46
+ "@ocap/mcrypto": "1.29.15",
47
+ "@ocap/message": "1.29.15",
48
+ "@ocap/types": "1.29.15",
49
+ "@ocap/util": "1.29.15",
50
+ "@ocap/wallet": "1.29.15",
51
51
  "bloom-filters": "^1.3.9",
52
52
  "lodash": "^4.17.23"
53
53
  },