Merge remote-tracking branch 'upstream/master' into spacesailor24/web3js-v4-upgrade

pull/3951/head
Oleksii Kosynskyi 1 year ago
commit da7864efab
No known key found for this signature in database
GPG Key ID: B4A8D3CCE22EA65E
  1. 1
      apps/debugger/src/app/debugger.ts
  2. 2
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  3. 10
      libs/ghaction-helper/package.json
  4. 8
      libs/remix-analyzer/package.json
  5. 6
      libs/remix-astwalker/package.json
  6. 12
      libs/remix-debug/package.json
  7. 4
      libs/remix-lib/package.json
  8. 18
      libs/remix-lib/src/execution/logsManager.ts
  9. 6
      libs/remix-simulator/package.json
  10. 2
      libs/remix-simulator/src/VmProxy.ts
  11. 122
      libs/remix-simulator/test/events.ts
  12. 40
      libs/remix-simulator/test/transactions.ts
  13. 6
      libs/remix-solidity/package.json
  14. 10
      libs/remix-tests/package.json
  15. 6
      libs/remix-ui/tree-view/src/lib/tree-view-item/tree-view-item.tsx
  16. 15
      libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx
  17. 18
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  18. 4
      libs/remix-ui/workspace/src/lib/components/file-render.tsx
  19. 2
      libs/remix-ui/workspace/src/lib/css/file-explorer.css
  20. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  21. 4
      libs/remix-url-resolver/package.json
  22. 4
      libs/remix-ws-templates/package.json
  23. 2
      libs/remixd/package.json

@ -28,4 +28,3 @@ export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) {
onStartDebugging: (debuggerBackend: any) => void // called when debug starts onStartDebugging: (debuggerBackend: any) => void // called when debug starts
onStopDebugging: () => void // called when debug stops onStopDebugging: () => void // called when debug stops
} }

@ -97,7 +97,7 @@ module.exports = {
.switchEnvironment('vm-london') .switchEnvironment('vm-london')
.click('*[data-id="terminalClearConsole"]') // clear the terminal .click('*[data-id="terminalClearConsole"]') // clear the terminal
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.click('*[data-id="treeViewDivtreeViewItem"]') // make sure we create the file at the root folder .click('*[data-id="treeViewDivMenu"]') // make sure we create the file at the root folder
.addFile('deployWithEthersJs.js', { content: deployWithEthersJs }) .addFile('deployWithEthersJs.js', { content: deployWithEthersJs })
// .openFile('deployWithEthersJs.js') // .openFile('deployWithEthersJs.js')
.pause(1000) .pause(1000)

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/ghaction-helper", "name": "@remix-project/ghaction-helper",
"version": "0.1.12", "version": "0.1.13",
"description": "Solidity Tests GitHub Action Helper", "description": "Solidity Tests GitHub Action Helper",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
@ -19,18 +19,18 @@
}, },
"homepage": "https://github.com/ethereum/remix-project#readme", "homepage": "https://github.com/ethereum/remix-project#readme",
"devDependencies": { "devDependencies": {
"@remix-project/remix-solidity": "^0.5.18", "@remix-project/remix-solidity": "^0.5.19",
"@types/chai": "^4.3.4", "@types/chai": "^4.3.4",
"typescript": "^4.9.3" "typescript": "^4.9.3"
}, },
"dependencies": { "dependencies": {
"@ethereum-waffle/chai": "^3.4.4", "@ethereum-waffle/chai": "^3.4.4",
"@remix-project/remix-simulator": "^0.2.32", "@remix-project/remix-simulator": "^0.2.33",
"chai": "^4.3.7", "chai": "^4.3.7",
"ethers": "^5.7.2", "ethers": "^5.7.2",
"web3": "^4.1.1" "web3": "^4.1.1"
}, },
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
"gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220"
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-analyzer", "name": "@remix-project/remix-analyzer",
"version": "0.5.41", "version": "0.5.42",
"description": "Tool to perform static analysis on Solidity smart contracts", "description": "Tool to perform static analysis on Solidity smart contracts",
"scripts": { "scripts": {
"test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
@ -25,8 +25,8 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-astwalker": "^0.0.62", "@remix-project/remix-astwalker": "^0.0.63",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"async": "^2.6.2", "async": "^2.6.2",
"ethers": "^5.4.2", "ethers": "^5.4.2",
"ethjs-util": "^0.1.6", "ethjs-util": "^0.1.6",
@ -50,6 +50,6 @@
"typescript": "^3.7.5" "typescript": "^3.7.5"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40", "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220",
"main": "./src/index.js" "main": "./src/index.js"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-astwalker", "name": "@remix-project/remix-astwalker",
"version": "0.0.62", "version": "0.0.63",
"description": "Tool to walk through Solidity AST", "description": "Tool to walk through Solidity AST",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
@ -37,7 +37,7 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"@types/tape": "^4.2.33", "@types/tape": "^4.2.33",
"async": "^2.6.2", "async": "^2.6.2",
"ethers": "^5.4.2", "ethers": "^5.4.2",
@ -53,6 +53,6 @@
"tap-spec": "^5.0.0" "tap-spec": "^5.0.0"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40", "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-debug", "name": "@remix-project/remix-debug",
"version": "0.5.32", "version": "0.5.33",
"description": "Tool to debug Ethereum transactions", "description": "Tool to debug Ethereum transactions",
"contributors": [ "contributors": [
{ {
@ -26,10 +26,10 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-astwalker": "^0.0.62", "@remix-project/remix-astwalker": "^0.0.63",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"@remix-project/remix-simulator": "^0.2.32", "@remix-project/remix-simulator": "^0.2.33",
"@remix-project/remix-solidity": "^0.5.18", "@remix-project/remix-solidity": "^0.5.19",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.2", "async": "^2.6.2",
"color-support": "^1.1.3", "color-support": "^1.1.3",
@ -69,6 +69,6 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40", "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-lib", "name": "@remix-project/remix-lib",
"version": "0.5.39", "version": "0.5.40",
"description": "Library to various Remix tools", "description": "Library to various Remix tools",
"contributors": [ "contributors": [
{ {
@ -53,6 +53,6 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40", "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -1,5 +1,6 @@
import { eachOf } from 'async' import { eachOf } from 'async'
import { randomBytes } from 'crypto' import { randomBytes } from 'crypto'
import { toChecksumAddress } from '@ethereumjs/util'
export class LogsManager { export class LogsManager {
notificationCallbacks notificationCallbacks
@ -21,8 +22,8 @@ export class LogsManager {
const txHash = '0x' + tx.hash().toString('hex') const txHash = '0x' + tx.hash().toString('hex')
web3.eth.getTransactionReceipt(txHash, (_error, receipt) => { web3.eth.getTransactionReceipt(txHash, (_error, receipt) => {
for (const log of receipt.logs) { for (const log of receipt.logs) {
this.oldLogs.push({ type: 'block', blockNumber, block, tx, log, txNumber: i }) this.oldLogs.push({ type: 'block', blockNumber, block, tx, log, txNumber: i, receipt })
const subscriptions = this.getSubscriptionsFor({ type: 'block', blockNumber, block, tx, log }) const subscriptions = this.getSubscriptionsFor({ type: 'block', blockNumber, block, tx, log, receipt})
for (const subscriptionId of subscriptions) { for (const subscriptionId of subscriptions) {
const result = { const result = {
logIndex: '0x1', // 1 logIndex: '0x1', // 1
@ -53,15 +54,18 @@ export class LogsManager {
if (queryFilter.topics.filter((logTopic) => changeEvent.log.topics.indexOf(logTopic) >= 0).length === 0) return false if (queryFilter.topics.filter((logTopic) => changeEvent.log.topics.indexOf(logTopic) >= 0).length === 0) return false
if (queryType === 'logs') { if (queryType === 'logs') {
const fromBlock = queryFilter.fromBlock || '0x0' const fromBlock = parseInt(queryFilter.fromBlock || '0x0')
const toBlock = queryFilter.toBlock || this.oldLogs.length ? this.oldLogs[this.oldLogs.length - 1].blockNumber : '0x0' let toBlock
if ((queryFilter.address === (changeEvent.tx.to || '').toString()) || queryFilter.address === (changeEvent.tx.getSenderAddress().toString())) { if (queryFilter.toBlock === 'latest' || !queryFilter.toBlock) toBlock = Number.MAX_VALUE
if ((parseInt(toBlock) >= parseInt(changeEvent.blockNumber)) && (parseInt(fromBlock) <= parseInt(changeEvent.blockNumber))) { else toBlock = parseInt(queryFilter.toBlock)
const targetAddress = toChecksumAddress(queryFilter.address)
if ((toBlock >= parseInt(changeEvent.blockNumber)) && (fromBlock <= parseInt(changeEvent.blockNumber))) {
if (changeEvent.log && changeEvent.log.address === targetAddress) {
return true return true
} }
} }
return false
} }
return false return false
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-simulator", "name": "@remix-project/remix-simulator",
"version": "0.2.32", "version": "0.2.33",
"description": "Ethereum IDE and tools for the web", "description": "Ethereum IDE and tools for the web",
"contributors": [ "contributors": [
{ {
@ -22,7 +22,7 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^3.1.0", "async": "^3.1.0",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
@ -68,6 +68,6 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40", "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -182,7 +182,7 @@ export class VmProxy {
topics.push('0x') topics.push('0x')
} }
logs.push({ logs.push({
address: '0x' + log[0].toString('hex'), address: toChecksumAddress('0x' + log[0].toString('hex')),
data: '0x' + log[2].toString('hex'), data: '0x' + log[2].toString('hex'),
topics: topics, topics: topics,
rawVMResponse: log rawVMResponse: log

@ -0,0 +1,122 @@
/* global describe, before, it */
import Web3 from 'web3'
import { Provider } from '../src/index'
const web3 = new Web3()
import * as assert from 'assert'
describe('Events', () => {
before(async function () {
const provider = new Provider()
await provider.init()
web3.setProvider(provider as any)
})
describe('eth_getLogs', () => {
it('should deploy 2 contracts which emit events and retrieve these events using different block ranges', async function () {
const accounts: string[] = await web3.eth.getAccounts()
// deploy the contract "test".
const receiptTest = await web3.eth.sendTransaction({
from: accounts[0],
gas: 1000000,
data: '0x608060405234801561001057600080fd5b506101ea806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80632801617e14610030575b600080fd5b61004a6004803603810190610045919061015d565b61004c565b005b8073ffffffffffffffffffffffffffffffffffffffff1663a6f9dae1306040518263ffffffff1660e01b81526004016100859190610199565b600060405180830381600087803b15801561009f57600080fd5b505af11580156100b3573d6000803e3d6000fd5b50505050607b7fdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc60405160405180910390a250565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610118826100ed565b9050919050565b600061012a8261010d565b9050919050565b61013a8161011f565b811461014557600080fd5b50565b60008135905061015781610131565b92915050565b600060208284031215610173576101726100e8565b5b600061018184828501610148565b91505092915050565b6101938161010d565b82525050565b60006020820190506101ae600083018461018a565b9291505056fea2646970667358221220cf5368dd204d44a75752e8ba7512b73d2f54b09f6ca6147e376dd3cf2942b96464736f6c63430008120033'
})
// deploy the contract "owner", this will trigger an event.
const receiptOwner = await web3.eth.sendTransaction({
from: accounts[0],
gas: 1000000,
data: '0x608060405234801561001057600080fd5b5061005a6040518060400160405280601b81526020017f4f776e657220636f6e7472616374206465706c6f7965642062793a00000000008152503361011a60201b61015b1760201c565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a361034d565b6101b882826040516024016101309291906102ee565b6040516020818303038152906040527f319af333000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506101bc60201b60201c565b5050565b6101dd816101d86101e060201b6101f71761020160201b60201c565b60201c565b50565b60006a636f6e736f6c652e6c6f679050600080835160208501845afa505050565b61021360201b61023d17819050919050565b61021b61031e565b565b600081519050919050565b600082825260208201905092915050565b60005b8381101561025757808201518184015260208101905061023c565b60008484015250505050565b6000601f19601f8301169050919050565b600061027f8261021d565b6102898185610228565b9350610299818560208601610239565b6102a281610263565b840191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102d8826102ad565b9050919050565b6102e8816102cd565b82525050565b600060408201905081810360008301526103088185610274565b905061031760208301846102df565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052605160045260246000fd5b6104268061035c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063893d20e81461003b578063a6f9dae114610059575b600080fd5b610043610075565b6040516100509190610288565b60405180910390f35b610073600480360381019061006e91906102d4565b61009e565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73560405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6101f38282604051602401610171929190610391565b6040516020818303038152906040527f319af333000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610218565b5050565b60006a636f6e736f6c652e6c6f679050600080835160208501845afa505050565b61022f816102276101f7610232565b63ffffffff16565b50565b61023d819050919050565b6102456103c1565b565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061027282610247565b9050919050565b61028281610267565b82525050565b600060208201905061029d6000830184610279565b92915050565b600080fd5b6102b181610267565b81146102bc57600080fd5b50565b6000813590506102ce816102a8565b92915050565b6000602082840312156102ea576102e96102a3565b5b60006102f8848285016102bf565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561033b578082015181840152602081019050610320565b60008484015250505050565b6000601f19601f8301169050919050565b600061036382610301565b61036d818561030c565b935061037d81856020860161031d565b61038681610347565b840191505092915050565b600060408201905081810360008301526103ab8185610358565b90506103ba6020830184610279565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052605160045260246000fdfea2646970667358221220cb7beb012e0831cc632ed85a11a8652f72efc03360c81beb1fcd842a7782c3cb64736f6c63430008120033'
})
// call function set(Owner p) from "test", this will trigger 2 events, one from each contract.
await web3.eth.sendTransaction({
from: accounts[0],
to: receiptTest.contractAddress,
gas: 1000000,
data: '0x2801617e' + web3.utils.padLeft(receiptOwner.contractAddress, 64).replace('0x', '')
})
const testLogs = await web3.eth.getPastLogs({
address: receiptTest.contractAddress,
fromBlock: 3,
toBlock: 'latest',
topics: ['0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc', '0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735']
})
let ownerLogs = await web3.eth.getPastLogs({
address: receiptOwner.contractAddress,
fromBlock: 3,
toBlock: 'latest',
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
})
// this should include the event triggered by the "set" transaction call.
assert.equal(testLogs.length, 1)
assert.equal(ownerLogs.length, 1)
ownerLogs = await web3.eth.getPastLogs({
address: receiptOwner.contractAddress,
fromBlock: 2,
toBlock: 'latest',
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
})
// this should include the event triggered from the ctor.
assert.equal(ownerLogs.length, 2)
ownerLogs = await web3.eth.getPastLogs({
address: receiptOwner.contractAddress,
fromBlock: 1,
toBlock: 2,
topics: ['0x342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a735', '0xdcd9c7fa0342f01013bd0bf2bec103a81936162dcebd1f0c38b1d4164c17e0fc']
})
// this should only include the event triggered from the ctor.
assert.equal(ownerLogs.length, 1)
})
})
})
/*
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "hardhat/console.sol";
contract test {
event testEvent(uint indexed value);
function set(Owner p) public {
p.changeOwner(address(this));
emit testEvent(123);
}
}
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");
_;
}
constructor() {
console.log("Owner contract deployed by:", msg.sender);
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
function changeOwner(address newOwner) public {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
function getOwner() external view returns (address) {
return owner;
}
}
*/

@ -0,0 +1,40 @@
/* global describe, before, it */
import Web3 from 'web3'
import { Provider } from '../src/index'
const web3 = new Web3()
import * as assert from 'assert'
describe('Transactions', () => {
before(async function () {
const provider = new Provider({ fork: 'shanghai'})
await provider.init()
web3.setProvider(provider as any)
})
describe('eth_sendTransaction', () => {
it('should deploy Storage contract, save a number and retrieve it', async function () {
const accounts: string[] = await web3.eth.getAccounts()
let receipt = await web3.eth.sendTransaction({
from: accounts[0],
gas: 1000000,
data: '0x608060405234801561000f575f80fd5b506101438061001d5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80632e64cec1146100385780636057361d14610056575b5f80fd5b610040610072565b60405161004d919061009b565b60405180910390f35b610070600480360381019061006b91906100e2565b61007a565b005b5f8054905090565b805f8190555050565b5f819050919050565b61009581610083565b82525050565b5f6020820190506100ae5f83018461008c565b92915050565b5f80fd5b6100c181610083565b81146100cb575f80fd5b50565b5f813590506100dc816100b8565b92915050565b5f602082840312156100f7576100f66100b4565b5b5f610104848285016100ce565b9150509291505056fea2646970667358221220bfa7ddc6d937b635c7a8ad020080923800f04f6b0a685c47330306fd5267626b64736f6c63430008150033'
})
const storageAddress = receipt.contractAddress
const receiptPull = await web3.eth.getTransactionReceipt(receipt.transactionHash)
assert.equal(receiptPull.contractAddress, receipt.contractAddress)
receipt = await web3.eth.sendTransaction({
from: accounts[0],
to: storageAddress,
gas: 1000000,
data: '0x6057361d000000000000000000000000000000000000000000000000000000000000000e'
})
const value = await web3.eth.call({
from: accounts[0],
to: storageAddress,
data: '0x2e64cec1'
})
assert.notEqual(value, 15)
assert.equal(value, 14)
})
})
})

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-solidity", "name": "@remix-project/remix-solidity",
"version": "0.5.18", "version": "0.5.19",
"description": "Tool to load and run Solidity compiler", "description": "Tool to load and run Solidity compiler",
"main": "src/index.js", "main": "src/index.js",
"types": "src/index.d.ts", "types": "src/index.d.ts",
@ -19,7 +19,7 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"async": "^2.6.2", "async": "^2.6.2",
"eslint-scope": "^5.0.0", "eslint-scope": "^5.0.0",
"ethers": "^5.4.2", "ethers": "^5.4.2",
@ -57,5 +57,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40" "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-tests", "name": "@remix-project/remix-tests",
"version": "0.2.32", "version": "0.2.33",
"description": "Tool to test Solidity smart contracts", "description": "Tool to test Solidity smart contracts",
"main": "src/index.js", "main": "src/index.js",
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
@ -41,9 +41,9 @@
"@ethereumjs/tx": "^4.1.1", "@ethereumjs/tx": "^4.1.1",
"@ethereumjs/util": "^8.0.5", "@ethereumjs/util": "^8.0.5",
"@ethereumjs/vm": "^6.4.1", "@ethereumjs/vm": "^6.4.1",
"@remix-project/remix-lib": "^0.5.39", "@remix-project/remix-lib": "^0.5.40",
"@remix-project/remix-simulator": "^0.2.32", "@remix-project/remix-simulator": "^0.2.33",
"@remix-project/remix-solidity": "^0.5.18", "@remix-project/remix-solidity": "^0.5.19",
"@remix-project/remix-url-resolver": "^0.0.42", "@remix-project/remix-url-resolver": "^0.0.42",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.0", "async": "^2.6.0",
@ -78,5 +78,5 @@
"typescript": "^3.3.1" "typescript": "^3.3.1"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40" "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220"
} }

@ -20,11 +20,11 @@ export const TreeViewItem = (props: TreeViewItemProps) => {
onClick={() => !controlBehaviour && setIsExpanded(!isExpanded)} onClick={() => !controlBehaviour && setIsExpanded(!isExpanded)}
> >
{children && showIcon ? ( {children && showIcon ? (
<div className={isExpanded ? `px-0 ${iconY}` : `px-1 ${iconX} caret caret_tv`} style={{visibility: children ? 'visible' : 'hidden'}}></div> <div className={isExpanded ? `pl-2 ${iconY}` : `pl-2 ${iconX} caret caret_tv`} style={{visibility: children ? 'visible' : 'hidden'}}></div>
) : icon ? ( ) : icon ? (
<div className={`pr-3 pl-1 ${icon} caret caret_tv`}></div> <div className={`pr-2 pl-2 ${icon} caret caret_tv`}></div>
) : null} ) : null}
<span className="w-100 pl-1">{label}</span> <span className="w-100 ml-1 pl-2">{label}</span>
</div> </div>
{isExpanded ? children : null} {isExpanded ? children : null}
</li> </li>

@ -29,13 +29,13 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
{ {
action: 'uploadFile', action: 'uploadFile',
title: 'Upload files into current workspace', title: 'Upload files into current workspace',
icon: 'fa fa-upload', icon: 'far fa-upload',
placement: 'top' placement: 'top'
}, },
{ {
action: 'uploadFolder', action: 'uploadFolder',
title: 'Upload folder into current workspace', title: 'Upload folder into current workspace',
icon: 'fas fa-folder-upload', icon: 'far fa-folder-upload',
placement: 'top' placement: 'top'
}, },
{ {
@ -83,7 +83,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />} tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />}
key={`index-${action}-${placement}-${icon}`} key={`index-${action}-${placement}-${icon}`}
> >
<label id={action} data-id={'fileExplorerUploadFile' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}> <label id={action} style={{fontSize: '1.1rem', cursor: 'pointer'}} data-id={'fileExplorerUploadFile' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}>
<input <input
id="fileUpload" id="fileUpload"
data-id="fileExplorerFileUpload" data-id="fileExplorerFileUpload"
@ -108,7 +108,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />} tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />}
key={`index-${action}-${placement}-${icon}`} key={`index-${action}-${placement}-${icon}`}
> >
<label id={action} data-id={'fileExplorerUploadFolder' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}> <label id={action} style={{fontSize: '1.1rem', cursor: 'pointer'}} data-id={'fileExplorerUploadFolder' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}>
<input <input
id="folderUpload" id="folderUpload"
data-id="fileExplorerFolderUpload" data-id="fileExplorerFolderUpload"
@ -134,8 +134,9 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />} tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />}
key={`${action}-${title}-${index}`} key={`${action}-${title}-${index}`}
> >
<span <label
id={action} id={action}
style={{fontSize: '1.1rem', cursor: 'pointer'}}
data-id={'fileExplorerNewFile' + action} data-id={'fileExplorerNewFile' + action}
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
@ -150,9 +151,9 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
state.actions[action]() state.actions[action]()
} }
}} }}
className={'newFile ' + icon + ' px-1 remixui_newFile'} className={'newFile ' + icon + ' pr-2 pl-1 remixui_newFile'}
key={`${action}-${title}-${index}`} key={`${action}-${title}-${index}`}
></span> ></label>
</CustomTooltip> </CustomTooltip>
) )
} }

@ -319,10 +319,13 @@ export const FileExplorer = (props: FileExplorerProps) => {
<Drag onFileMoved={handleFileMove} onFolderMoved={handleFolderMove}> <Drag onFileMoved={handleFileMove} onFolderMoved={handleFolderMove}>
<div ref={treeRef} tabIndex={0} style={{outline: 'none'}}> <div ref={treeRef} tabIndex={0} style={{outline: 'none'}}>
<TreeView id="treeView"> <TreeView id="treeView">
<TreeViewItem <li key={`treeViewLiMenu`} data-id={`treeViewLiMenu`} className="li_tv">
id="treeViewItem" <div
controlBehaviour={true} key={`treeViewDivMenu`}
label={ data-id={`treeViewDivMenu`}
className={`d-flex flex-row align-items-center`}
>
<span className="w-100 pl-2">
<div onClick={handleFileExplorerMenuClick}> <div onClick={handleFileExplorerMenuClick}>
<FileExplorerMenu <FileExplorerMenu
title={''} title={''}
@ -334,9 +337,9 @@ export const FileExplorer = (props: FileExplorerProps) => {
uploadFolder={uploadFolder} uploadFolder={uploadFolder}
/> />
</div> </div>
} </span>
expand={true} </div>
> </li>
<div className="pb-4 mb-4"> <div className="pb-4 mb-4">
<TreeView id="treeViewMenu"> <TreeView id="treeViewMenu">
{files[ROOT_PATH] && {files[ROOT_PATH] &&
@ -361,7 +364,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
))} ))}
</TreeView> </TreeView>
</div> </div>
</TreeViewItem>
</TreeView> </TreeView>
</div> </div>
</Drag> </Drag>

@ -85,8 +85,8 @@ export const FileRender = (props: RenderFileProps) => {
return ( return (
<TreeViewItem <TreeViewItem
id={`treeViewItem${file.path}`} id={`treeViewItem${file.path}`}
iconX="pr-3 fa fa-folder" iconX="mr-2 fa fa-folder"
iconY={props.expandPath.includes(file.path) ? 'pr-0 fa fa-folder-open' : 'pr-3 fa fa-folder'} iconY={props.expandPath.includes(file.path) ? 'fa fa-folder-open' : 'fa fa-folder'}
key={`${file.path + props.index}`} key={`${file.path + props.index}`}
label={ label={
<> <>

@ -1,6 +1,6 @@
.remixui_label { .remixui_label {
margin-top : 4px; margin-top : 4px;
user-select: none; user-select : none;
} }
.remixui_leaf { .remixui_leaf {
overflow : hidden; overflow : hidden;

@ -861,10 +861,10 @@ export function Workspace() {
}} }}
> >
<div className="d-flex flex-column w-100 pb-4 mb-2 remixui_fileexplorer" data-id="remixUIWorkspaceExplorer" onClick={resetFocus}> <div className="d-flex flex-column w-100 pb-4 mb-2 remixui_fileexplorer" data-id="remixUIWorkspaceExplorer" onClick={resetFocus}>
<div> <div className='mb-1'>
<header> <header>
<div className="mx-2 my-2 d-flex flex-column"> <div className="mx-2 my-2 d-flex flex-column">
<div className="d-flex"> <div className="mx-2 d-flex">
{currentWorkspace !== LOCALHOST ? ( {currentWorkspace !== LOCALHOST ? (
<span className="remixui_topmenu d-flex"> <span className="remixui_topmenu d-flex">
<Dropdown id="workspacesMenuDropdown" data-id="workspacesMenuDropdown" onToggle={() => hideIconsMenu(!showIconsMenu)} show={showIconsMenu}> <Dropdown id="workspacesMenuDropdown" data-id="workspacesMenuDropdown" onToggle={() => hideIconsMenu(!showIconsMenu)} show={showIconsMenu}>
@ -904,6 +904,7 @@ export function Workspace() {
</label> </label>
</span> </span>
</div> </div>
<div className='mx-2'>
<Dropdown id="workspacesSelect" data-id="workspacesSelect" onToggle={toggleDropdown} show={showDropdown}> <Dropdown id="workspacesSelect" data-id="workspacesSelect" onToggle={toggleDropdown} show={showDropdown}>
<Dropdown.Toggle <Dropdown.Toggle
as={CustomToggle} as={CustomToggle}
@ -971,6 +972,7 @@ export function Workspace() {
</Dropdown.Menu> </Dropdown.Menu>
</Dropdown> </Dropdown>
</div> </div>
</div>
</header> </header>
</div> </div>
<div <div

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-url-resolver", "name": "@remix-project/remix-url-resolver",
"version": "0.0.61", "version": "0.0.62",
"description": "Solidity import url resolver engine", "description": "Solidity import url resolver engine",
"main": "src/index.js", "main": "src/index.js",
"types": "src/index.d.ts", "types": "src/index.d.ts",
@ -40,5 +40,5 @@
"typescript": "^3.1.6" "typescript": "^3.1.6"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40" "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-ws-templates", "name": "@remix-project/remix-ws-templates",
"version": "1.0.26", "version": "1.0.27",
"description": "Create a Remix IDE workspace using different templates", "description": "Create a Remix IDE workspace using different templates",
"main": "src/index.js", "main": "src/index.js",
"types": "src/index.d.ts", "types": "src/index.d.ts",
@ -24,5 +24,5 @@
"ethers": "^5.4.2", "ethers": "^5.4.2",
"web3": "^4.1.1" "web3": "^4.1.1"
}, },
"gitHead": "335beb044cbd9d58c255bd8441a310757c99bf40" "gitHead": "b6db2a29c223e423c70f06b87d9b245e26f0b220"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remixd", "name": "@remix-project/remixd",
"version": "0.6.17", "version": "0.6.18",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",

Loading…
Cancel
Save