Merge branch 'master' into fix_toaster_provider_update

pull/1987/head
David Disu 3 years ago committed by GitHub
commit 193564345f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 107
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  2. 6
      apps/remix-ide/src/app/plugins/remixd-handle.tsx
  3. 1
      libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx
  4. 1
      libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx
  5. 2
      libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx
  6. 2
      libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx
  7. 11
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css
  8. 6
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -195,6 +195,26 @@ module.exports = {
.journalLastChildIncludes('"documentation": "param2 from library"') .journalLastChildIncludes('"documentation": "param2 from library"')
.journalLastChildIncludes('"documentation": "param3 from library"') .journalLastChildIncludes('"documentation": "param3 from library"')
.journalLastChildIncludes('Debug the transaction to get more information.') .journalLastChildIncludes('Debug the transaction to get more information.')
},
'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) {
browser
.addFile('Storage.sol', sources[6]['Storage.sol'])
.addFile('Owner.sol', sources[6]['Owner.sol'])
.clickLaunchIcon('udapp')
.createContract('42')
.openFile('Storage.sol')
.clickLaunchIcon('udapp')
.createContract('') // this creation will fail if the component hasn't been properly reset.
.clickInstance(1)
.clickFunction('store - transact (not payable)', { types: 'uint256 num', values: '24' })
.testFunction('last', // we check if the contract is actually reachable.
{
status: 'true Transaction mined and execution succeed',
'decoded input': {
'uint256 num': '24'
}
})
.end() .end()
} }
} }
@ -322,5 +342,92 @@ contract C {
} }
}` }`
} }
},
{
'Owner.sol': {
content: `
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor(uint p) {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}`
},
'Storage.sol': {
content: `
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}`
}
} }
] ]

@ -142,11 +142,11 @@ function remixdDialog () {
</div> </div>
<div className='mb-2 text-break'> <div className='mb-2 text-break'>
If you are just looking for the remixd command, here it is: If you are just looking for the remixd command, here it is:
<br></br><br></br><b>${commandText}</b> <br></br><br></br><b>{commandText}</b>
<CopyToClipboard data-id='remixdCopyCommand' content={commandText}></CopyToClipboard> <CopyToClipboard data-id='remixdCopyCommand' content={commandText}></CopyToClipboard>
</div> </div>
<div className='mb-2 text-break'> <div className='mb-2 text-break'>
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>. 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>.
The shared folder will be in the "File Explorers" workspace named "localhost". The shared folder will be in the "File Explorers" workspace named "localhost".
<br/>Read more about other <a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage">Remixd ports usage</a> <br/>Read more about other <a target="_blank" href="https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage">Remixd ports usage</a>
</div> </div>
@ -155,7 +155,7 @@ function remixdDialog () {
</div> </div>
<div className='mb-2 text-break'> <div className='mb-2 text-break'>
<h6 className="text-danger"> <h6 className="text-danger">
Before using, make sure remixd version is latest i.e. <b>${remixdVersion}</b> Before using, make sure remixd version is latest i.e. <b>v{remixdVersion}</b>
<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> <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>
</h6> </h6>
</div> </div>

@ -173,7 +173,6 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
_paq.push(['trackEvent', 'pluginManager', 'userActivate', 'sourcify']) _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'sourcify'])
} }
const startPluginManager = async () => { const startPluginManager = async () => {
await plugin.appManager.activatePlugin('pluginManager')
plugin.verticalIcons.select('pluginManager') plugin.verticalIcons.select('pluginManager')
} }

@ -25,6 +25,7 @@ export function ContractGUI (props: ContractGUIProps) {
} else { } else {
setTitle(props.funcABI.type === 'receive' ? '(receive)' : '(fallback)') setTitle(props.funcABI.type === 'receive' ? '(receive)' : '(fallback)')
} }
setBasicInput('')
}, [props.title, props.funcABI]) }, [props.title, props.funcABI])
useEffect(() => { useEffect(() => {

@ -7,7 +7,7 @@ interface HomeProps {
function Home ({ verticalIconPlugin }: HomeProps) { function Home ({ verticalIconPlugin }: HomeProps) {
return ( return (
<div <div
className="mt-3 my-1 remixui_homeIcon" className="mt-2 my-1 remixui_homeIcon"
onClick={async () => await verticalIconPlugin.activateHome()} onClick={async () => await verticalIconPlugin.activateHome()}
{...{ plugin: 'home'}} {...{ plugin: 'home'}}
title="Home" title="Home"

@ -85,7 +85,7 @@ const Icon = ({
return ( return (
<> <>
<div <div
className={`remixui_icon m-2 pl-1`} className={`remixui_icon m-2 pt-1`}
onClick={() => { onClick={() => {
(verticalIconPlugin as any).toggle(name) (verticalIconPlugin as any).toggle(name)
}} }}

@ -29,6 +29,7 @@
width: 36px; width: 36px;
height: 36px; height: 36px;
border-radius: 8px; border-radius: 8px;
align-items: center;
} }
.remixui_icon img { .remixui_icon img {
width: 28px; width: 28px;
@ -39,15 +40,12 @@
.remixui_icon .selected-dark { .remixui_icon .selected-dark {
filter: invert(1) grayscale(1); filter: invert(1) grayscale(1);
} }
.remixui_icon .selected-light { .remixui_icon .selected-light {
filter: invert(0) grayscale(1); filter: invert(0) grayscale(1);
} }
.remixui_image {
}
.remixui_icon svg { .remixui_icon svg {
width: 28px; width: 28px;
height: 28px; height: 28px;
@ -119,9 +117,12 @@
} }
.remixui_default-icons-container { .remixui_default-icons-container {
border-bottom: 2px solid #3f4455; border-bottom: 2px solid #3f4455;
text-align: center;
} }
.remixui_icon-chevron { .remixui_icon-chevron {
z-index: 1000; z-index: 1000;
cursor: pointer;
align-items: center;
} }
.remixui_settings { .remixui_settings {
@ -132,7 +133,3 @@
list-style: none; list-style: none;
margin: 0px; margin: 0px;
} }
.remixui_icon-chevron {
cursor: pointer;
}

@ -90,7 +90,7 @@ const RemixUiVerticalIconsPanel = ({
<Chevron <Chevron
direction='up' direction='up'
divElementRef={scrollableRef} divElementRef={scrollableRef}
cssRule={'fa fa-chevron-up remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'} cssRule={'fa fa-chevron-up remixui_icon-chevron my-0'}
/> />
) : null ) : null
} }
@ -109,11 +109,11 @@ const RemixUiVerticalIconsPanel = ({
itemContextAction={itemContextAction} itemContextAction={itemContextAction}
/> />
</div> </div>
<div> <div className="remixui_default-icons-container border-0">
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron { scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron
divElementRef={scrollableRef} divElementRef={scrollableRef}
direction='down' direction='down'
cssRule={'fa fa-chevron-down remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'} cssRule={'fa fa-chevron-down remixui_icon-chevron my-0'}
/>) : null } />) : null }
<IconList <IconList
theme={theme} theme={theme}

Loading…
Cancel
Save