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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
36 deletions
+85
-36
config.yml
.circleci/config.yml
+2
-0
solidityUnittests.spec.ts
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
+34
-20
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
+15
-3
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:
steps
:
-
checkout
-
run
:
npm install
-
run
:
npm run downloadsolc_assets
-
run
:
npx nx build remix-ide --with-deps
-
run
:
name
:
Download Selenium
...
...
@@ -171,6 +172,7 @@ jobs:
steps
:
-
checkout
-
run
:
npm install
-
run
:
npm run downloadsolc_assets
-
run
:
npx nx build remix-ide --with-deps
-
run
:
name
:
Download Selenium
...
...
apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
View file @
617078b8
...
...
@@ -166,27 +166,41 @@ module.exports = {
.
verify
.
attributeEquals
(
'*[data-id="uiPathInput"]'
,
'value'
,
'tests'
)
},
'Solidity Unittests'
:
function
(
browser
:
NightwatchBrowser
)
{
runTests
(
browser
)
}
}
'Solidity Unit tests Basic'
:
function
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
clickLaunchIcon
(
'filePanel'
)
.
click
(
'*[data-id="treeViewLitreeViewItemcontracts"]'
)
.
openFile
(
'contracts/3_Ballot.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
pause
(
2000
)
.
verify
.
attributeEquals
(
'*[data-id="uiPathInput"]'
,
'value'
,
'tests'
)
.
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
)
},
function
runTests
(
browser
:
NightwatchBrowser
)
{
browser
.
waitForElementPresent
(
'*[data-id="verticalIconsKindfilePanel"]'
)
.
clickLaunchIcon
(
'filePanel'
)
.
click
(
'*[data-id="treeViewLitreeViewItemcontracts"]'
)
.
openFile
(
'contracts/3_Ballot.sol'
)
.
clickLaunchIcon
(
'solidityUnitTesting'
)
.
pause
(
2000
)
.
verify
.
attributeEquals
(
'*[data-id="uiPathInput"]'
,
'value'
,
'tests'
)
.
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
()
'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
()
}
}
const
sources
=
[
...
...
apps/remix-ide/src/app/tabs/test-tab.js
View file @
617078b8
...
...
@@ -278,6 +278,8 @@ module.exports = class TestTab extends ViewPlugin {
</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 = {}
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
*/
export
function
urlFromVersion
(
version
)
{
if
(
!
version
.
startsWith
(
'soljson-v'
))
version
=
'soljson-v'
+
version
if
(
!
version
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
return
`
${
pathToURL
[
version
]}
/
${
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
.
endsWith
(
'.js'
))
version
=
version
+
'.js'
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
const
method
=
testObject
.
methods
[
func
.
name
].
apply
(
testObject
.
methods
[
func
.
name
],
[])
const
startTime
=
Date
.
now
()
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
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
)
{
const
resp
:
TestResultInterface
=
{
type
:
'testPass'
,
...
...
@@ -254,6 +261,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
time
:
time
,
context
:
testName
}
if
(
hhLogs
)
resp
.
hhLogs
=
hhLogs
testCallback
(
undefined
,
resp
)
passingNum
+=
1
timePassed
+=
time
...
...
@@ -266,6 +274,7 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
errMsg
:
'function returned false'
,
context
:
testName
}
if
(
hhLogs
)
resp
.
hhLogs
=
hhLogs
testCallback
(
undefined
,
resp
)
failureNum
+=
1
timePassed
+=
time
...
...
@@ -338,6 +347,17 @@ export function runTest (testName: string, testObject: any, contractDetails: Com
testCallback
(
undefined
,
resp
)
passingNum
+=
1
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
()
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx
View file @
617078b8
...
...
@@ -5,7 +5,6 @@ import { BN } from 'ethereumjs-util'
export
const
GlobalVariables
=
({
block
,
receipt
,
tx
})
=>
{
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
const
globals
=
{
'block.basefee'
:
(
new
BN
(
block
.
baseFeePerGas
.
replace
(
'0x'
,
''
),
'hex'
)).
toString
(
10
)
+
` Wei (
${
block
.
baseFeePerGas
}
)`
,
'block.chainid'
:
tx
.
chainId
,
'block.coinbase'
:
block
.
miner
,
'block.difficulty'
:
block
.
difficulty
,
...
...
@@ -17,6 +16,10 @@ export const GlobalVariables = ({ block, receipt, tx }) => {
'msg.value'
:
tx
.
value
+
' Wei'
,
'tx.origin'
:
tx
.
from
}
if
(
block
.
baseFeePerGas
)
{
globals
[
'block.basefee'
]
=
(
new
BN
(
block
.
baseFeePerGas
.
replace
(
'0x'
,
''
),
'hex'
)).
toString
(
10
)
+
` Wei (
${
block
.
baseFeePerGas
}
)`
}
return
(
<
div
id=
'globalvariable'
data
-
id=
'globalvariable'
>
<
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) => {
updateCurrentVersion
(
selectedVersion
)
url
=
customUrl
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
{
if
(
selectedVersion
.
indexOf
(
'soljson'
)
!==
0
||
helper
.
checkSpecialChars
(
selectedVersion
))
{
return
console
.
log
(
'loading '
+
selectedVersion
+
' not allowed'
)
if
(
helper
.
checkSpecialChars
(
selectedVersion
))
{
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
...
...
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