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
617078b8
Unverified
Commit
617078b8
authored
Aug 31, 2021
by
David Zagi
Committed by
GitHub
Aug 31, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into remixd_terminal
parents
53fed4f2
5c08cdd5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
20 deletions
+69
-20
config.yml
.circleci/config.yml
+2
-0
solidityUnittests.spec.ts
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
+20
-6
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+2
-0
compiler-utils.ts
libs/remix-solidity/src/compiler/compiler-utils.ts
+13
-1
testRunner.ts
libs/remix-tests/src/testRunner.ts
+21
-1
global-variables.tsx
...x-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx
+4
-1
compiler-container.tsx
...remix-ui/solidity-compiler/src/lib/compiler-container.tsx
+7
-11
No files found.
.circleci/config.yml
View file @
617078b8
...
@@ -105,6 +105,7 @@ jobs:
...
@@ -105,6 +105,7 @@ jobs:
steps
:
steps
:
-
checkout
-
checkout
-
run
:
npm install
-
run
:
npm install
-
run
:
npm run downloadsolc_assets
-
run
:
npx nx build remix-ide --with-deps
-
run
:
npx nx build remix-ide --with-deps
-
run
:
-
run
:
name
:
Download Selenium
name
:
Download Selenium
...
@@ -171,6 +172,7 @@ jobs:
...
@@ -171,6 +172,7 @@ jobs:
steps
:
steps
:
-
checkout
-
checkout
-
run
:
npm install
-
run
:
npm install
-
run
:
npm run downloadsolc_assets
-
run
:
npx nx build remix-ide --with-deps
-
run
:
npx nx build remix-ide --with-deps
-
run
:
-
run
:
name
:
Download Selenium
name
:
Download Selenium
...
...
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
View file @
617078b8
...
@@ -166,12 +166,7 @@ module.exports = {
...
@@ -166,12 +166,7 @@ module.exports = {
.
verify
.
attributeEquals
(
'*[data-id="uiPathInput"]'
,
'value'
,
'tests'
)
.
verify
.
attributeEquals
(
'*[data-id="uiPathInput"]'
,
'value'
,
'tests'
)
},
},
'Solidity Unittests'
:
function
(
browser
:
NightwatchBrowser
)
{
'Solidity Unit tests Basic'
:
function
(
browser
:
NightwatchBrowser
)
{
runTests
(
browser
)
}
}
function
runTests
(
browser
:
NightwatchBrowser
)
{
browser
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
clickLaunchIcon
(
'filePanel'
)
.
clickLaunchIcon
(
'filePanel'
)
...
@@ -186,7 +181,26 @@ function runTests (browser: NightwatchBrowser) {
...
@@ -186,7 +181,26 @@ function runTests (browser: NightwatchBrowser) {
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'/tests/4_Ballot_test.sol'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'/tests/4_Ballot_test.sol'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winning proposal'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winning proposal'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
},
'Solidity Unit tests Basic Basic with local compiler'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
clickLaunchIcon
(
'solidity'
)
.
setSolidityCompilerVersion
(
'builtin'
)
.
openFile
(
'contracts/3_Ballot.sol'
)
.
clickLaunchIcon
(
'pluginManager'
)
.
scrollAndClick
(
'[data-id="pluginManagerComponentDeactivateButtonsolidityUnitTesting"]'
)
.
pause
(
2000
)
.
scrollAndClick
(
'[data-id="pluginManagerComponentActivateButtonsolidityUnitTesting"]'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
scrollAndClick
(
'#runTestsTabRunAction'
)
.
waitForElementVisible
(
'*[data-id="testTabSolidityUnitTestsOutputheader"]'
,
120000
)
.
waitForElementPresent
(
'#solidityUnittestsOutput div[class^="testPass"]'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'/tests/4_Ballot_test.sol'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winning proposal'
,
60000
)
.
waitForElementContainsText
(
'#solidityUnittestsOutput'
,
'✓ Check winnin proposal with return value'
,
60000
)
.
end
()
.
end
()
}
}
}
const
sources
=
[
const
sources
=
[
...
...
apps/remix-ide/src/app/tabs/test-tab.js
View file @
617078b8
...
@@ -278,6 +278,8 @@ module.exports = class TestTab extends ViewPlugin {
...
@@ -278,6 +278,8 @@ module.exports = class TestTab extends ViewPlugin {
</div>
</div>
`
)
`
)
}
}
}
else
if
(
result
.
type
===
'logOnly'
)
{
if
(
result
.
hhLogs
&&
result
.
hhLogs
.
length
)
this
.
printHHLogs
(
result
.
hhLogs
,
result
.
value
)
}
}
}
}
...
...
libs/remix-solidity/src/compiler/compiler-utils.ts
View file @
617078b8
...
@@ -12,9 +12,21 @@ export const pathToURL = {}
...
@@ -12,9 +12,21 @@ export const pathToURL = {}
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
*/
*/
export
function
urlFromVersion
(
version
)
{
export
function
urlFromVersion
(
version
)
{
let
url
if
(
version
===
'builtin'
)
{
let
location
:
string
|
Location
=
window
.
document
.
location
let
path
=
location
.
pathname
if
(
!
path
.
startsWith
(
'/'
))
path
=
'/'
+
path
location
=
`
${
location
.
protocol
}
//
${
location
.
host
}${
path
}
assets/js`
if
(
location
.
endsWith
(
'index.html'
))
location
=
location
.
substring
(
0
,
location
.
length
-
10
)
if
(
!
location
.
endsWith
(
'/'
))
location
+=
'/'
url
=
`
${
location
}
soljson.js`
}
else
{
if
(
!
version
.
startsWith
(
'soljson-v'
))
version
=
'soljson-v'
+
version
if
(
!
version
.
startsWith
(
'soljson-v'
))
version
=
'soljson-v'
+
version
if
(
!
version
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
if
(
!
version
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
return
`
${
pathToURL
[
version
]}
/
${
version
}
`
url
=
`
${
pathToURL
[
version
]}
/
${
version
}
`
}
return
url
}
}
/**
/**
...
...
libs/remix-tests/src/testRunner.ts
View file @
617078b8
...
@@ -244,8 +244,15 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
...
@@ -244,8 +244,15 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
const
method
=
testObject
.
methods
[
func
.
name
].
apply
(
testObject
.
methods
[
func
.
name
],
[])
const
method
=
testObject
.
methods
[
func
.
name
].
apply
(
testObject
.
methods
[
func
.
name
],
[])
const
startTime
=
Date
.
now
()
const
startTime
=
Date
.
now
()
if
(
func
.
constant
)
{
if
(
func
.
constant
)
{
method
.
call
(
sendParams
).
then
((
result
)
=>
{
sendParams
=
{}
const
tagTimestamp
=
'remix_tests_tag'
+
Date
.
now
()
sendParams
.
timestamp
=
tagTimestamp
method
.
call
(
sendParams
).
then
(
async
(
result
)
=>
{
const
time
=
(
Date
.
now
()
-
startTime
)
/
1000.0
const
time
=
(
Date
.
now
()
-
startTime
)
/
1000.0
let
tagTxHash
let
hhLogs
if
(
web3
.
eth
&&
web3
.
eth
.
getHashFromTagBySimulator
)
tagTxHash
=
await
web3
.
eth
.
getHashFromTagBySimulator
(
tagTimestamp
)
if
(
web3
.
eth
&&
web3
.
eth
.
getHHLogsForTx
)
hhLogs
=
await
web3
.
eth
.
getHHLogsForTx
(
tagTxHash
)
if
(
result
)
{
if
(
result
)
{
const
resp
:
TestResultInterface
=
{
const
resp
:
TestResultInterface
=
{
type
:
'testPass'
,
type
:
'testPass'
,
...
@@ -254,6 +261,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
...
@@ -254,6 +261,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
time
:
time
,
time
:
time
,
context
:
testName
context
:
testName
}
}
if
(
hhLogs
)
resp
.
hhLogs
=
hhLogs
testCallback
(
undefined
,
resp
)
testCallback
(
undefined
,
resp
)
passingNum
+=
1
passingNum
+=
1
timePassed
+=
time
timePassed
+=
time
...
@@ -266,6 +274,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
...
@@ -266,6 +274,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
errMsg
:
'function returned false'
,
errMsg
:
'function returned false'
,
context
:
testName
context
:
testName
}
}
if
(
hhLogs
)
resp
.
hhLogs
=
hhLogs
testCallback
(
undefined
,
resp
)
testCallback
(
undefined
,
resp
)
failureNum
+=
1
failureNum
+=
1
timePassed
+=
time
timePassed
+=
time
...
@@ -338,6 +347,17 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
...
@@ -338,6 +347,17 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
testCallback
(
undefined
,
resp
)
testCallback
(
undefined
,
resp
)
passingNum
+=
1
passingNum
+=
1
timePassed
+=
time
timePassed
+=
time
}
else
if
(
hhLogs
)
{
const
resp
:
TestResultInterface
=
{
type
:
'logOnly'
,
value
:
changeCase
.
sentenceCase
(
func
.
name
),
filename
:
testObject
.
filename
,
time
:
time
,
context
:
testName
,
hhLogs
}
testCallback
(
undefined
,
resp
)
timePassed
+=
time
}
}
return
next
()
return
next
()
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx
View file @
617078b8
...
@@ -5,7 +5,6 @@ import { BN } from 'ethereumjs-util'
...
@@ -5,7 +5,6 @@ import { BN } from 'ethereumjs-util'
export
const
GlobalVariables
=
({
block
,
receipt
,
tx
})
=>
{
export
const
GlobalVariables
=
({
block
,
receipt
,
tx
})
=>
{
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
const
globals
=
{
const
globals
=
{
'block.basefee'
:
(
new
BN
(
block
.
baseFeePerGas
.
replace
(
'0x'
,
''
),
'hex'
)).
toString
(
10
)
+
` Wei (
${
block
.
baseFeePerGas
}
)`
,
'block.chainid'
:
tx
.
chainId
,
'block.chainid'
:
tx
.
chainId
,
'block.coinbase'
:
block
.
miner
,
'block.coinbase'
:
block
.
miner
,
'block.difficulty'
:
block
.
difficulty
,
'block.difficulty'
:
block
.
difficulty
,
...
@@ -17,6 +16,10 @@ export const GlobalVariables = ({ block, receipt, tx }) => {
...
@@ -17,6 +16,10 @@ export const GlobalVariables = ({ block, receipt, tx }) => {
'msg.value'
:
tx
.
value
+
' Wei'
,
'msg.value'
:
tx
.
value
+
' Wei'
,
'tx.origin'
:
tx
.
from
'tx.origin'
:
tx
.
from
}
}
if
(
block
.
baseFeePerGas
)
{
globals
[
'block.basefee'
]
=
(
new
BN
(
block
.
baseFeePerGas
.
replace
(
'0x'
,
''
),
'hex'
)).
toString
(
10
)
+
` Wei (
${
block
.
baseFeePerGas
}
)`
}
return
(
return
(
<
div
id=
'globalvariable'
data
-
id=
'globalvariable'
>
<
div
id=
'globalvariable'
data
-
id=
'globalvariable'
>
<
DropdownPanel
hexHighlight=
{
false
}
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Global Variables'
calldata=
{
globals
||
{}
}
/>
<
DropdownPanel
hexHighlight=
{
false
}
bodyStyle=
{
{
fontFamily
:
'monospace'
}
}
dropdownName=
'Global Variables'
calldata=
{
globals
||
{}
}
/>
...
...
libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
View file @
617078b8
...
@@ -333,19 +333,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
...
@@ -333,19 +333,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
updateCurrentVersion
(
selectedVersion
)
updateCurrentVersion
(
selectedVersion
)
url
=
customUrl
url
=
customUrl
api
.
setParameters
({
version
:
selectedVersion
})
api
.
setParameters
({
version
:
selectedVersion
})
}
else
if
(
selectedVersion
===
'builtin'
)
{
let
location
:
string
|
Location
=
window
.
document
.
location
let
path
=
location
.
pathname
if
(
!
path
.
startsWith
(
'/'
))
path
=
'/'
+
path
location
=
`
${
location
.
protocol
}
//
${
location
.
host
}${
path
}
assets/js`
if
(
location
.
endsWith
(
'index.html'
))
location
=
location
.
substring
(
0
,
location
.
length
-
10
)
if
(
!
location
.
endsWith
(
'/'
))
location
+=
'/'
url
=
location
+
'soljson.js'
}
else
{
}
else
{
if
(
selectedVersion
.
indexOf
(
'soljson'
)
!==
0
||
helper
.
checkSpecialChars
(
selectedVersion
))
{
if
(
helper
.
checkSpecialChars
(
selectedVersion
))
{
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed'
)
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed, special chars not allowed.'
)
}
if
(
selectedVersion
===
'builtin'
||
selectedVersion
.
indexOf
(
'soljson'
)
===
0
)
{
url
=
urlFromVersion
(
selectedVersion
)
}
else
{
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed, version should start with "soljson"'
)
}
}
url
=
`
${
urlFromVersion
(
selectedVersion
)}
`
}
}
// Workers cannot load js on "file:"-URLs and we get a
// Workers cannot load js on "file:"-URLs and we get a
...
...
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