Skip to content

Commit 1935643

Browse files
authored
Merge branch 'master' into fix_toaster_provider_update
2 parents 4316cec + 1522a16 commit 1935643

File tree

8 files changed

+131
-27
lines changed

8 files changed

+131
-27
lines changed

apps/remix-ide-e2e/src/tests/transactionExecution.test.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,26 @@ module.exports = {
195195
.journalLastChildIncludes('"documentation": "param2 from library"')
196196
.journalLastChildIncludes('"documentation": "param3 from library"')
197197
.journalLastChildIncludes('Debug the transaction to get more information.')
198+
},
199+
200+
'Should compile and deploy 2 simple contracts, the contract creation component state should be correctly reset for the deployment of the second contract #group4': function (browser: NightwatchBrowser) {
201+
browser
202+
.addFile('Storage.sol', sources[6]['Storage.sol'])
203+
.addFile('Owner.sol', sources[6]['Owner.sol'])
204+
.clickLaunchIcon('udapp')
205+
.createContract('42')
206+
.openFile('Storage.sol')
207+
.clickLaunchIcon('udapp')
208+
.createContract('') // this creation will fail if the component hasn't been properly reset.
209+
.clickInstance(1)
210+
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '24' })
211+
.testFunction('last', // we check if the contract is actually reachable.
212+
{
213+
status: 'true Transaction mined and execution succeed',
214+
'decoded input': {
215+
'uint256 num': '24'
216+
}
217+
})
198218
.end()
199219
}
200220
}
@@ -322,5 +342,92 @@ contract C {
322342
}
323343
}`
324344
}
345+
},
346+
{
347+
'Owner.sol': {
348+
content: `
349+
// SPDX-License-Identifier: GPL-3.0
350+
351+
pragma solidity >=0.7.0 <0.9.0;
352+
353+
/**
354+
* @title Owner
355+
* @dev Set & change owner
356+
*/
357+
contract Owner {
358+
359+
address private owner;
360+
361+
// event for EVM logging
362+
event OwnerSet(address indexed oldOwner, address indexed newOwner);
363+
364+
// modifier to check if caller is owner
365+
modifier isOwner() {
366+
// If the first argument of 'require' evaluates to 'false', execution terminates and all
367+
// changes to the state and to Ether balances are reverted.
368+
// This used to consume all gas in old EVM versions, but not anymore.
369+
// It is often a good idea to use 'require' to check if functions are called correctly.
370+
// As a second argument, you can also provide an explanation about what went wrong.
371+
require(msg.sender == owner, "Caller is not owner");
372+
_;
373+
}
374+
375+
/**
376+
* @dev Set contract deployer as owner
377+
*/
378+
constructor(uint p) {
379+
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
380+
emit OwnerSet(address(0), owner);
381+
}
382+
383+
/**
384+
* @dev Change owner
385+
* @param newOwner address of new owner
386+
*/
387+
function changeOwner(address newOwner) public isOwner {
388+
emit OwnerSet(owner, newOwner);
389+
owner = newOwner;
390+
}
391+
392+
/**
393+
* @dev Return owner address
394+
* @return address of owner
395+
*/
396+
function getOwner() external view returns (address) {
397+
return owner;
398+
}
399+
}`
400+
},
401+
'Storage.sol': {
402+
content: `
403+
// SPDX-License-Identifier: GPL-3.0
404+
405+
pragma solidity >=0.7.0 <0.9.0;
406+
407+
/**
408+
* @title Storage
409+
* @dev Store & retrieve value in a variable
410+
*/
411+
contract Storage {
412+
413+
uint256 number;
414+
415+
/**
416+
* @dev Store value in variable
417+
* @param num value to store
418+
*/
419+
function store(uint256 num) public {
420+
number = num;
421+
}
422+
423+
/**
424+
* @dev Return value
425+
* @return value of 'number'
426+
*/
427+
function retrieve() public view returns (uint256){
428+
return number;
429+
}
430+
}`
431+
}
325432
}
326433
]

apps/remix-ide/src/app/plugins/remixd-handle.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ function remixdDialog () {
142142
</div>
143143
<div className='mb-2 text-break'>
144144
If you are just looking for the remixd command, here it is:
145-
<br></br><br></br><b>${commandText}</b>
145+
<br></br><br></br><b>{commandText}</b>
146146
<CopyToClipboard data-id='remixdCopyCommand' content={commandText}></CopyToClipboard>
147147
</div>
148148
<div className='mb-2 text-break'>
149-
When connected, a session will be started between <em>${window.location.origin}</em> and your local file system at <i>ws://127.0.0.1:65520</i>.
149+
When connected, a session will be started between <em>{window.location.origin}</em> and your local file system at <i>ws://127.0.0.1:65520</i>.
150150
The shared folder will be in the "File Explorers" workspace named "localhost".
151151
<br/>Read more about other <a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage">Remixd ports usage</a>
152152
</div>
@@ -155,7 +155,7 @@ function remixdDialog () {
155155
</div>
156156
<div className='mb-2 text-break'>
157157
<h6 className="text-danger">
158-
Before using, make sure remixd version is latest i.e. <b>${remixdVersion}</b>
158+
Before using, make sure remixd version is latest i.e. <b>v{remixdVersion}</b>
159159
<br></br><a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd">Read here how to update it</a>
160160
</h6>
161161
</div>

libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
173173
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'sourcify'])
174174
}
175175
const startPluginManager = async () => {
176-
await plugin.appManager.activatePlugin('pluginManager')
177176
plugin.verticalIcons.select('pluginManager')
178177
}
179178

libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function ContractGUI (props: ContractGUIProps) {
2525
} else {
2626
setTitle(props.funcABI.type === 'receive' ? '(receive)' : '(fallback)')
2727
}
28+
setBasicInput('')
2829
}, [props.title, props.funcABI])
2930

3031
useEffect(() => {

libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface HomeProps {
77
function Home ({ verticalIconPlugin }: HomeProps) {
88
return (
99
<div
10-
className="mt-3 my-1 remixui_homeIcon"
10+
className="mt-2 my-1 remixui_homeIcon"
1111
onClick={async () => await verticalIconPlugin.activateHome()}
1212
{...{ plugin: 'home'}}
1313
title="Home"

libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const Icon = ({
8585
return (
8686
<>
8787
<div
88-
className={`remixui_icon m-2 pl-1`}
88+
className={`remixui_icon m-2 pt-1`}
8989
onClick={() => {
9090
(verticalIconPlugin as any).toggle(name)
9191
}}

libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
width: 36px;
3030
height: 36px;
3131
border-radius: 8px;
32+
align-items: center;
3233
}
3334
.remixui_icon img {
3435
width: 28px;
@@ -39,15 +40,12 @@
3940

4041
.remixui_icon .selected-dark {
4142
filter: invert(1) grayscale(1);
42-
4343
}
4444

4545
.remixui_icon .selected-light {
4646
filter: invert(0) grayscale(1);
4747
}
4848

49-
.remixui_image {
50-
}
5149
.remixui_icon svg {
5250
width: 28px;
5351
height: 28px;
@@ -119,9 +117,12 @@
119117
}
120118
.remixui_default-icons-container {
121119
border-bottom: 2px solid #3f4455;
120+
text-align: center;
122121
}
123122
.remixui_icon-chevron {
124123
z-index: 1000;
124+
cursor: pointer;
125+
align-items: center;
125126
}
126127

127128
.remixui_settings {
@@ -132,7 +133,3 @@
132133
list-style: none;
133134
margin: 0px;
134135
}
135-
136-
.remixui_icon-chevron {
137-
cursor: pointer;
138-
}

libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const RemixUiVerticalIconsPanel = ({
9090
<Chevron
9191
direction='up'
9292
divElementRef={scrollableRef}
93-
cssRule={'fa fa-chevron-up remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'}
93+
cssRule={'fa fa-chevron-up remixui_icon-chevron my-0'}
9494
/>
9595
) : null
9696
}
@@ -109,19 +109,19 @@ const RemixUiVerticalIconsPanel = ({
109109
itemContextAction={itemContextAction}
110110
/>
111111
</div>
112-
<div>
113-
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron
114-
divElementRef={scrollableRef}
115-
direction='down'
116-
cssRule={'fa fa-chevron-down remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'}
117-
/>) : null }
118-
<IconList
119-
theme={theme}
120-
icons={icons.filter((p) => p.profile.name === 'settings' || p.profile.name === 'pluginManager')}
121-
verticalIconsPlugin={verticalIconsPlugin}
122-
itemContextAction={itemContextAction}
123-
/>
124-
</div>
112+
<div className="remixui_default-icons-container border-0">
113+
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron
114+
divElementRef={scrollableRef}
115+
direction='down'
116+
cssRule={'fa fa-chevron-down remixui_icon-chevron my-0'}
117+
/>) : null }
118+
<IconList
119+
theme={theme}
120+
icons={icons.filter((p) => p.profile.name === 'settings' || p.profile.name === 'pluginManager')}
121+
verticalIconsPlugin={verticalIconsPlugin}
122+
itemContextAction={itemContextAction}
123+
/>
124+
</div>
125125
</div>
126126
</div>
127127
)

0 commit comments

Comments
 (0)