Skip to content

Commit e0459fa

Browse files
0x009922Naghme98outoftardisNikita Zaporozhets
authored
Iroha 2.0.0-pre-rc.20 update (#172)
Signed-off-by: 0x009922 <[email protected]> Co-authored-by: Naghmeh Mohammadifar <[email protected]> Co-authored-by: Ekaterina Mekhnetsova <[email protected]> Co-authored-by: Nikita Zaporozhets <[email protected]>
1 parent 5923aac commit e0459fa

File tree

121 files changed

+5029
-5031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+5029
-5031
lines changed

.changeset/big-coins-film.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@iroha2/data-model-schema': major
3+
'@iroha2/data-model': major
4+
'@iroha2/client': major
5+
---
6+
7+
**Target [Iroha `2.0.0-pre-rc.20`](https://github.com/hyperledger/iroha/tree/51d687607fad067fc855e266edc684d4fb33e7de)**

.changeset/brave-doors-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iroha2/data-model': minor
3+
---
4+
5+
**build**: preserve modules for ESM and types target; update `exports` mapping in `package.json`

.changeset/clever-cups-swim.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@iroha2/data-model': major
3+
---
4+
5+
**feat!**: enhance schema transformation.
6+
7+
- Support new schema format
8+
- Remove null aliases. Mostly, it simplifies `QueryBox` enum, e.g. instead of `QueryBox('FindAllAccounts', null)` it is now enough to write `QueryBox('FindAllAccounts')`
9+
- Filter several single-field structures in order to avoid extra nesting. This includes:
10+
- `EvaluatesTo<..>`
11+
- `SignaturesOf<..>`
12+
- Simplify `HashOf<..>` to `Hash`
13+
- Handle `NonZero<..>` integers properly

.changeset/curly-news-approve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iroha2/client': patch
3+
---
4+
5+
refactor: follow the update of the data model

.changeset/happy-ears-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iroha2/data-model': minor
3+
---
4+
5+
**feat**: introduce `sugar` namespace to do common data-model operations more conveniently (wip)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
'@iroha2/data-model': major
3+
---
4+
5+
**refactor!**: join all data-model types as `datamodel` namespace export
6+
7+
##### What is the change
8+
9+
Previously, all data-model types were imported directly from the package:
10+
11+
```ts
12+
import { AccountId, DomainId } from '@iroha2/data-model'
13+
14+
const acc = AccountId({
15+
name: 'alice',
16+
domain_id: DomainId({
17+
name: 'wonderland',
18+
}),
19+
})
20+
```
21+
22+
Now all data-model types are joined into a single `datamodel` namespace:
23+
24+
```ts
25+
import { datamodel } from '@iroha2/data-model'
26+
27+
const acc = datamodel.AccountId({
28+
name: 'alice',
29+
domain_id: datamodel.DomainId({
30+
name: 'wonderland',
31+
}),
32+
})
33+
```
34+
35+
##### Why the change was made
36+
37+
38+
- To make it easier to distinguish data-model related exports from other utilities as there used to be too many root-level package exports, not always related to each other.
39+
- To make data model more compatible with how it is presented in Java SDK
40+
41+
##### How the consumer should update their code
42+
43+
The consumer should replace all data-model imports with `datamodel.*`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iroha2/data-model-schema': major
3+
---
4+
5+
**refactor!**: move schema-transform code back to `@iroha2/data-model` internal utilities

.changeset/serious-adults-play.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iroha2/data-model-schema': major
3+
---
4+
5+
**feat!**: update schema and its types; update type names

.eslintignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
dist
22
dist-tsc
3-
/packages/crypto/crypto-rs/wasm-pkg-*
43
/packages/data-model/src/__generated__.ts
4+
5+
/packages/crypto/crypto-rs/wasm-pkg-*
6+
/packages/crypto/crypto-rs/target
7+
/packages/data-model-rust-samples/target
8+

.eslintrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module.exports = {
22
extends: ['alloy', 'alloy/typescript'],
3+
parserOptions: {
4+
project: './tsconfig.eslint.json',
5+
},
36
rules: {
47
'no-promise-executor-return': 'off',
58
'spaced-comment': ['error', 'always', { markers: ['/'] }],
@@ -28,10 +31,15 @@ module.exports = {
2831
// ESLint Vue from web tests
2932
{
3033
files: ['**/packages/client/test/integration/test-web/src/**/*.vue'],
31-
extends: ['plugin:vue/vue3-recommended'],
34+
extends: [
35+
'plugin:vue/vue3-recommended',
36+
// no real need to apply type checked linting rules for integration tests
37+
'plugin:@typescript-eslint/disable-type-checked',
38+
],
3239
parserOptions: {
3340
ecmaVersion: 2020,
3441
parser: '@typescript-eslint/parser',
42+
extraFileExtensions: ['.vue'],
3543
},
3644
rules: {
3745
'vue/html-indent': ['warn', 2],

0 commit comments

Comments
 (0)