Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
8790f394
Unverified
Commit
8790f394
authored
Feb 09, 2021
by
yann300
Committed by
GitHub
Feb 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load base64 encoded code (#856)
fix
https://github.com/ethereum/remix-project/issues/852
parent
185899ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
url.test.ts
apps/remix-ide-e2e/src/tests/url.test.ts
+10
-1
app.js
apps/remix-ide/src/app.js
+9
-0
No files found.
apps/remix-ide-e2e/src/tests/url.test.ts
View file @
8790f394
...
@@ -11,13 +11,22 @@ const sources = [
...
@@ -11,13 +11,22 @@ const sources = [
module
.
exports
=
{
module
.
exports
=
{
before
:
function
(
browser
:
NightwatchBrowser
,
done
:
VoidFunction
)
{
before
:
function
(
browser
:
NightwatchBrowser
,
done
:
VoidFunction
)
{
init
(
browser
,
done
,
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js'
)
init
(
browser
,
done
,
'http://127.0.0.1:8080/#optimize=true&runs=300&evmVersion=istanbul&version=soljson-v0.7.4+commit.3f05b770.js
&code=cHJhZ21hIHNvbGlkaXR5ID49MC42LjAgPDAuNy4wOwoKaW1wb3J0ICJodHRwczovL2dpdGh1Yi5jb20vT3BlblplcHBlbGluL29wZW56ZXBwZWxpbi1jb250cmFjdHMvYmxvYi9tYXN0ZXIvY29udHJhY3RzL2FjY2Vzcy9Pd25hYmxlLnNvbCI7Cgpjb250cmFjdCBHZXRQYWlkIGlzIE93bmFibGUgewogIGZ1bmN0aW9uIHdpdGhkcmF3KCkgZXh0ZXJuYWwgb25seU93bmVyIHsKICB9Cn0
'
)
},
},
'@sources'
:
function
()
{
'@sources'
:
function
()
{
return
sources
return
sources
},
},
'Should load the code from URL params'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
getEditorValue
((
content
)
=>
{
browser
.
assert
.
ok
(
content
.
indexOf
(
'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol'
)
!=
-
1
,
'code has not been loaded'
)
})
},
'Should load using URL compiler params'
:
function
(
browser
:
NightwatchBrowser
)
{
'Should load using URL compiler params'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
browser
.
assert
.
containsText
(
'#versionSelector option[selected="selected"]'
,
'0.7.4+commit.3f05b770'
)
.
assert
.
containsText
(
'#versionSelector option[selected="selected"]'
,
'0.7.4+commit.3f05b770'
)
...
...
apps/remix-ide/src/app.js
View file @
8790f394
...
@@ -459,5 +459,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -459,5 +459,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
})
})
}
}
if
(
params
.
code
)
{
try
{
const
path
=
'browser/.code-sample/contract.sol'
await
fileManager
.
writeFile
(
path
,
atob
(
params
.
code
))
await
fileManager
.
openFile
(
path
)
}
catch
(
e
)
{
console
.
error
(
e
)
}
}
if
(
params
.
embed
)
framingService
.
embed
()
if
(
params
.
embed
)
framingService
.
embed
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment