-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Optimise File-Explorer #1140
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
Optimise File-Explorer #1140
Conversation
b5ad8f2 to
825e956
Compare
| .perform(() => { | ||
| browser | ||
| .testConstantFunction(addressRef, 'get - call', null, '0:\nuint256: 45') | ||
| .testConstantFunction(addressRef, 'getInt - call', null, '0:\nuint256: 45') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling get should have worked.
getInt is calling the lib, but here we are testing that the lib is correctly linked to the contract.
the contract is:
function get () public view returns (uint) {
return lib.getInt();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yann300 I will need your help to figure out why testing get from libs fail.
| } | ||
|
|
||
| exists (path, cb) { | ||
| async exists (path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to add async if the content of the function is not using await ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding async returns a promise. I added it because fileManager expects a promise just like how remixdProvider returns a promise.
| path = path.replace(/^\/|\/$/g, '') // remove first and last slash | ||
| if (path.startsWith(this.workspacesPath + '/' + this.workspace)) return path | ||
| if (path.startsWith(this.workspace)) return this.workspacesPath + '/' + this.workspace | ||
| if (path.startsWith(this.workspace)) return path.replace(this.workspace, this.workspacesPath + '/' + this.workspace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand this change, is this a fix for when a folder has the same name as the workspace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes an issue i had when querying provider.exists(). If i have a path like default_workspace/contracts/ballot.sol, before resolving if the path exists removePrefix() is called. Now with the previous check, since the path starts with default_workspace, .workspaces/default_workspace is returned and when this (.workspaces/default_workspace) is checked if it exists, it always returns true. My change fixes that.
apps/remix-ide/src/lib/helper.js
Outdated
| createNonClashingName (name, fileProvider, cb) { | ||
| this.createNonClashingNameWithPrefix(name, fileProvider, '', cb) | ||
| }, | ||
| async checkNonClashingNameAsync (name, fileManager, prefix = '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be createNonClashingNameAsync ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename it to createNonClashingNameAsync. It is the same implementation but async without callbacks.
988c7b6 to
a1a18d9
Compare
|
Cannot create workspaces, it actually creates a workspace directory, empty, in the default workspace. Somehow it also creates workspaces, sometimes, but you only see the list of spaces created before you create the new one. However it doesn't happen always, but it happens. Tried in incognito, cleared the storage. It also throws a lot of errors. The selector is stuck at connecting to localhost and can't find .workspaces. Who said coding wasn't fun? |
cb53bdf to
9daf546
Compare




Fixes #950