Skip to content

Conversation

@gleb-urvanov
Copy link
Contributor

No description provided.

Copy link
Member

@mnaamani mnaamani left a comment

Choose a reason for hiding this comment

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

I was able to run the test-migration successfully. I left a few comments about re-organizing some of the folder structure, but I'm okay with these changes being made later as there are several other PRs depending on this.

The main issue that needs to be resolved here however is how to properly have dependencies mutltiple different versions of our "types" package.

"dependencies": {
"@joystream/types": "^0.7.0",
"@joystream/types": "../joystream-apps/packages/joy-types",
"@rome/types@npm:@joystream/types": "^0.7.0",
Copy link
Member

Choose a reason for hiding this comment

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

I see the first "@joystream/types": "../joystream-apps/packages/joy-types", is just a relative path to the latest constantinople @joystream/types package.

But I wanted to confirm my understanding, "@rome/types@npm:@joystream/types" is setting some sort of alias from @rome/types to @joystream/types published on npm ?

Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to do something like:

    "@constantinople/types@npm:@joystream/types": "^0.8.0",
    "@rome/types@npm:@joystream/types": "^0.7.0",

This might be useful but what would be more helpful is to see if we can have two packages in the same workspace setup the same alias to two different versions of the same package name?

Copy link
Member

Choose a reason for hiding this comment

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

We cannot merge with package.json having such a relative path to a dependency.
How can we tackle this.

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 see the first "@joystream/types": "../joystream-apps/packages/joy-types", is just a relative path to the latest constantinople @joystream/types package.

But I wanted to confirm my understanding, "@rome/types@npm:@joystream/types" is setting some sort of alias from @rome/types to @joystream/types published on npm ?

Exactly, it's an alias.

Would it be possible to do something like:

"@constantinople/types@npm:@joystream/types": "^0.8.0",
"@rome/types@npm:@joystream/types": "^0.7.0",

Yes, after .8 will be published to nexus

We cannot merge with package.json having such a relative path to a dependency.
How can we tackle this.

We can either publish .8 types, or I can put a placeholder here for the relative path.

import { membershipTest } from './membershipCreationTest';
import { KeyringPair } from '@polkadot/keyring/types';
import { ApiWrapper } from '../utils/apiWrapper';
import { ApiWrapper } from '../../utils/apiWrapper';
Copy link
Member

Choose a reason for hiding this comment

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

It probably makes sense to move the top utils folder inside constantinople folder (like rome) so it will be clear which code is for which version of the network.

// Proposal creation
const proposalPromise = apiWrapper.expectProposalCreated();
await apiWrapper.proposeRuntime(
await apiWrapper.proposeRuntimeRome(
Copy link
Member

Choose a reason for hiding this comment

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

I'm not so sure about adding Rome suffix here in the names of the functions. It doesn't seem necessary if we are separating the code for different networks into separate folders.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed.

}

public static readRuntimeFromFile(path: string): string {
return '0x' + fs.readFileSync(path).toString('hex');
Copy link
Member

Choose a reason for hiding this comment

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

Why is this function necessary. In other words, why are we having to pass the wasm blob as a hex string in the call to create the runtime upgrade proposal. Isn't it possible to pass the Buffer type or at least convert it more efficiently to the required Codec type.

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 will give it a try and will push the changes.

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 found no way to pass the Buffer, and changed the conversion to

u8aToHex(...)

But the object passed to API is still a hex string.

@mnaamani mnaamani self-requested a review May 15, 2020 08:49
@mnaamani mnaamani merged commit 6a0fc82 into Joystream:development May 15, 2020
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.

2 participants