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
fa218bdc
Commit
fa218bdc
authored
May 14, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
standart
parent
582f906f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
settings.js
src/app/tabs/runTab/model/settings.js
+2
-1
settings.js
src/app/tabs/runTab/settings.js
+2
-1
contracts.js
test-browser/helpers/contracts.js
+6
-6
generalTests.js
test-browser/tests/generalTests.js
+8
-8
No files found.
src/app/tabs/runTab/model/settings.js
View file @
fa218bdc
var
ethJSUtil
=
require
(
'ethereumjs-util'
)
var
Personal
=
require
(
'web3-eth-personal'
)
var
remixLib
=
require
(
'remix-lib'
)
const
addTooltip
=
require
(
'../../../ui/tooltip'
)
var
EventManager
=
remixLib
.
EventManager
var
executionContext
=
remixLib
.
execution
.
executionContext
...
...
@@ -97,7 +98,7 @@ class Settings {
const
hashedMsg
=
executionContext
.
web3
().
sha3
(
message
)
try
{
executionContext
.
web3
().
eth
.
sign
(
account
,
hashedMsg
,
(
error
,
signedData
)
=>
{
if
(
!
error
)
a
lert
(
"Please check your provider"
)
if
(
!
error
)
a
ddTooltip
(
'Please check your provider to approve'
)
cb
(
error
,
hashedMsg
,
signedData
)
})
}
catch
(
e
)
{
...
...
src/app/tabs/runTab/settings.js
View file @
fa218bdc
...
...
@@ -223,8 +223,9 @@ class SettingsUI {
var
signMessageDialog
=
{
'title'
:
'Sign a message'
,
'text'
:
'Enter a message to sign'
,
'inputvalue'
:
'Message to sign'
}
var
$txOrigin
=
this
.
el
.
querySelector
(
'#txorigin'
)
if
(
!
$txOrigin
.
selectedOptions
[
0
]
&&
this
.
settings
.
isInjectedWeb3
())
if
(
!
$txOrigin
.
selectedOptions
[
0
]
&&
this
.
settings
.
isInjectedWeb3
())
{
return
addTooltip
(
`Account list is empty, please login to your wallet to load it`
)
}
var
account
=
$txOrigin
.
selectedOptions
[
0
].
value
var
promptCb
=
(
passphrase
)
=>
{
...
...
test-browser/helpers/contracts.js
View file @
fa218bdc
...
...
@@ -173,20 +173,20 @@ function signMsg (browser, msg, cb) {
let
hash
,
signature
browser
.
click
(
'i[id="remixRunSignMsg"]'
)
.
setValue
(
'textarea[id="prompt_text"]'
,
msg
,
()
=>
{
.
setValue
(
'textarea[id="prompt_text"]'
,
msg
,
()
=>
{
browser
.
modalFooterOKClick
().
perform
(
(
client
,
done
)
=>
{
browser
.
getText
(
'span[id="remixRunSignMsgHash"]'
,
(
v
)
=>
{
hash
=
v
;
done
()
})
(
client
,
done
)
=>
{
browser
.
getText
(
'span[id="remixRunSignMsgHash"]'
,
(
v
)
=>
{
hash
=
v
;
done
()
})
}
)
.
perform
(
(
client
,
done
)
=>
{
browser
.
getText
(
'span[id="remixRunSignMsgSignature"]'
,
(
v
)
=>
{
signature
=
v
;
done
()
})
(
client
,
done
)
=>
{
browser
.
getText
(
'span[id="remixRunSignMsgSignature"]'
,
(
v
)
=>
{
signature
=
v
;
done
()
})
}
)
.
modalFooterOKClick
()
.
perform
(
()
=>
{
()
=>
{
cb
(
hash
,
signature
)
}
)
...
...
test-browser/tests/generalTests.js
View file @
fa218bdc
...
...
@@ -163,23 +163,23 @@ function checkDeployShouldSucceed (browser, address, callback) {
function
testSignature
(
browser
,
callback
)
{
let
hash
,
signature
browser
.
clickLaunchIcon
(
"run"
).
pause
(
4000
).
perform
((
client
,
done
)
=>
{
contractHelper
.
signMsg
(
browser
,
"test message"
,
(
h
,
s
)
=>
{
browser
.
clickLaunchIcon
(
'run'
).
pause
(
4000
).
perform
((
client
,
done
)
=>
{
contractHelper
.
signMsg
(
browser
,
'test message'
,
(
h
,
s
)
=>
{
hash
=
h
signature
=
s
contractHelper
.
addFile
(
browser
,
"signMassage.sol"
,
sources
[
6
][
"browser/signMassage.sol"
],
()
=>
{
contractHelper
.
addFile
(
browser
,
'signMassage.sol'
,
sources
[
6
][
'browser/signMassage.sol'
],
()
=>
{
contractHelper
.
switchFile
(
browser
,
'browser/signMassage.sol'
,
()
=>
{
contractHelper
.
selectContract
(
browser
,
'ECVerify'
,
()
=>
{
// deploy lib
contractHelper
.
createContract
(
browser
,
''
,
()
=>
{
browser
.
waitForElementPresent
(
'.instance:nth-of-type(4)'
)
.
click
(
'.instance:nth-of-type(4) > div > button'
)
.
clickFunction
(
"ecrecovery - call"
,
{
types
:
"bytes32 hash, bytes sig"
,
values
:
`"
${
hash
.
value
}
","
${
signature
.
value
}
"`
}).
perform
(
()
=>
{
contractHelper
.
verifyCallReturn
V
alue
(
.
clickFunction
(
'ecrecovery - call'
,
{
types
:
'bytes32 hash, bytes sig'
,
values
:
`"
${
hash
.
value
}
","
${
signature
.
value
}
"`
}).
perform
(
()
=>
{
contractHelper
.
verifyCallReturnalue
(
browser
,
"0x08970fed061e7747cd9a38d680a601510cb659fb"
,
'0x08970fed061e7747cd9a38d680a601510cb659fb'
,
[
'0: address: 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c'
],
()
=>
{
callback
(
null
,
browser
)
}
()
=>
{
callback
(
null
,
browser
)
}
)
}
)
...
...
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