Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service contracts #74

Merged
merged 10 commits into from
Jan 3, 2023
Merged

Service contracts #74

merged 10 commits into from
Jan 3, 2023

Conversation

DylanVerstraete
Copy link
Contributor

@DylanVerstraete DylanVerstraete commented Dec 27, 2022

See [./development]

Make sure you increment the `specVersion` before you compile and run tfchain.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add this before the See development...

```

Notice the [104, null] definition, this means this type if valid from specVersion 104 until some to define perdiod (null if you don't know).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*this means this type is valid


- src/typesLocal/events.js
- src/typesLocal/$SPECVERSION.js
Copy link
Contributor

@renauter renauter Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ts instead of js

*- src/typesLocal/events.ts
*- src/typesLocal/$SPECVERSION.ts


Once you have done this, it's time to generate the types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move cd typegenLocal here ?

yarn build
yarn db:create-migration
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those instructions generate something?
the file in db/migrations I guess
Do we need to copy it from somewhere or it is already generated in the right dir ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I indeed generates a new database migration file, it's already placed in the right directory.

### 6: Create / extend mappers

Make the corresponding changes in `src/processor.ts` and mappers `src/mappings/..` for the type changes that were made
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see changes on those files in this PR but I guess this is because we don't modify existing types, we create new ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I ll do it ;)


Make the corresponding changes in `src/processor.ts` and mappers `src/mappings/..` for the type changes that were made

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some added files in src/model/generated
But I don't see how/when they are generated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn codegen

Steps:

- move new $specVersion.ts file to `src/types`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that all the file is nor copied... only the some part of it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, only the changed types need to be copied over

@renauter renauter marked this pull request as ready for review December 29, 2022 17:46
@DylanVerstraete DylanVerstraete merged commit 7cadeee into master Jan 3, 2023
@DylanVerstraete DylanVerstraete deleted the service_contracts branch January 3, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants