Refactor ghaction methods and publish libs

pull/5370/head
ioedeveloper 2 years ago
parent e4809780f6
commit 9ab12ff9d3
  1. 11
      libs/ghaction-helper/package.json
  2. 43
      libs/ghaction-helper/src/methods.ts
  3. 8
      libs/remix-analyzer/package.json
  4. 6
      libs/remix-astwalker/package.json
  5. 12
      libs/remix-debug/package.json
  6. 4
      libs/remix-lib/package.json
  7. 6
      libs/remix-simulator/package.json
  8. 6
      libs/remix-solidity/package.json
  9. 10
      libs/remix-tests/package.json
  10. 4
      libs/remix-url-resolver/package.json
  11. 4
      libs/remix-ws-templates/package.json

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/ghaction-helper", "name": "@remix-project/ghaction-helper",
"version": "0.1.7-alpha.6", "version": "0.1.7-alpha.10",
"description": "Solidity Tests GitHub Action Helper", "description": "Solidity Tests GitHub Action Helper",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
@ -19,16 +19,17 @@
}, },
"homepage": "https://github.com/ethereum/remix-project#readme", "homepage": "https://github.com/ethereum/remix-project#readme",
"devDependencies": { "devDependencies": {
"@remix-project/remix-solidity": "^0.5.11-alpha.6", "@remix-project/remix-solidity": "^0.5.11-alpha.10",
"@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.25-alpha.6", "@remix-project/remix-simulator": "^0.2.25-alpha.10",
"chai": "^4.3.7", "chai": "^4.3.7",
"ethers": "^5.7.2" "ethers": "^5.7.2",
"web3": "^1.5.3"
}, },
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
"gitHead": "a046bcad1c8fee07e1b32314af14ae859c66b760" "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c"
} }

@ -3,14 +3,23 @@ import { ethers } from "ethers"
import { Provider } from '@remix-project/remix-simulator' import { Provider } from '@remix-project/remix-simulator'
import { getArtifactsByContractName } from './artifacts-helper' import { getArtifactsByContractName } from './artifacts-helper'
import { SignerWithAddress } from './signer' import { SignerWithAddress } from './signer'
import Web3 from "web3"
const providerConfig = { (async () => {
fork: global.fork || null, const providerConfig = {
nodeUrl: global.nodeUrl || null, fork: global.fork || null,
blockNumber: global.blockNumber || null nodeUrl: global.nodeUrl || null,
} blockNumber: global.blockNumber || null
}
global.remixProvider = new Provider(providerConfig)
await global.remixProvider.init()
global.web3Provider = new ethers.providers.Web3Provider(global.remixProvider)
global.provider = global.web3Provider
global.ethereum = global.web3Provider
global.web3 = new Web3(global.web3Provider)
})()
global.remixProvider = new Provider(providerConfig)
const isFactoryOptions = (signerOrOptions: any) => { const isFactoryOptions = (signerOrOptions: any) => {
if (!signerOrOptions || signerOrOptions === undefined || signerOrOptions instanceof ethers.Signer) return false if (!signerOrOptions || signerOrOptions === undefined || signerOrOptions instanceof ethers.Signer) return false
return true return true
@ -164,17 +173,15 @@ const resultToArtifact = (result: any) => {
} }
const getContractFactory = async (contractNameOrABI: ethers.ContractInterface, bytecode?: string, signerOrOptions = null) => { const getContractFactory = async (contractNameOrABI: ethers.ContractInterface, bytecode?: string, signerOrOptions = null) => {
//@ts-ignore
if (!global.remixProvider.Transactions.txRunnerInstance) await remixProvider.init()
if (bytecode && contractNameOrABI) { if (bytecode && contractNameOrABI) {
//@ts-ignore //@ts-ignore
return new ethers.ContractFactory(contractNameOrABI, bytecode, signerOrOptions || (new ethers.providers.Web3Provider(remixProvider)).getSigner()) return new ethers.ContractFactory(contractNameOrABI, bytecode, signerOrOptions || web3Provider.getSigner())
} else if (typeof contractNameOrABI === 'string') { } else if (typeof contractNameOrABI === 'string') {
const contract = await getArtifactsByContractName(contractNameOrABI) const contract = await getArtifactsByContractName(contractNameOrABI)
if (contract) { if (contract) {
//@ts-ignore //@ts-ignore
return new ethers.ContractFactory(contract.abi, contract.evm.bytecode.object, signerOrOptions || (new ethers.providers.Web3Provider(remixProvider)).getSigner()) return new ethers.ContractFactory(contract.abi, contract.evm.bytecode.object, signerOrOptions || web3Provider.getSigner())
} else { } else {
throw new Error('Contract artifacts not found') throw new Error('Contract artifacts not found')
} }
@ -185,9 +192,7 @@ const getContractFactory = async (contractNameOrABI: ethers.ContractInterface, b
const getContractAt = async (contractNameOrABI: ethers.ContractInterface, address: string, signer = null) => { const getContractAt = async (contractNameOrABI: ethers.ContractInterface, address: string, signer = null) => {
//@ts-ignore //@ts-ignore
if (!global.remixProvider.Transactions.txRunnerInstance) await remixProvider.init() const provider = web3Provider
//@ts-ignore
const provider = new ethers.providers.Web3Provider(remixProvider)
if(typeof contractNameOrABI === 'string') { if(typeof contractNameOrABI === 'string') {
const result = await getArtifactsByContractName(contractNameOrABI) const result = await getArtifactsByContractName(contractNameOrABI)
@ -204,9 +209,7 @@ const getContractAt = async (contractNameOrABI: ethers.ContractInterface, addres
const getSigner = async (address: string) => { const getSigner = async (address: string) => {
//@ts-ignore //@ts-ignore
if (!global.remixProvider.Transactions.txRunnerInstance) await remixProvider.init() const provider = web3Provider
//@ts-ignore
const provider = new ethers.providers.Web3Provider(remixProvider)
const signer = provider.getSigner(address) const signer = provider.getSigner(address)
return SignerWithAddress.create(signer) return SignerWithAddress.create(signer)
@ -214,17 +217,13 @@ const getSigner = async (address: string) => {
const getSigners = async () => { const getSigners = async () => {
//@ts-ignore //@ts-ignore
if (!global.remixProvider.Transactions.txRunnerInstance) await remixProvider.init() const provider = web3Provider
//@ts-ignore
const provider = new ethers.providers.Web3Provider(remixProvider)
const accounts = await provider.listAccounts() const accounts = await provider.listAccounts()
return await Promise.all( accounts.map((account: any) => getSigner(account))) return await Promise.all( accounts.map((account: any) => getSigner(account)))
} }
const getContractFactoryFromArtifact = async (artifact: any, signerOrOptions: { signer: any, libraries: any }) => { const getContractFactoryFromArtifact = async (artifact: any, signerOrOptions: { signer: any, libraries: any }) => {
//@ts-ignore
if (!global.remixProvider.Transactions.txRunnerInstance) await remixProvider.init()
let libraries = {} let libraries = {}
let signer let signer
@ -250,7 +249,7 @@ If you want to call a contract using ${artifact.contractName} as its interface u
const linkedBytecode = await collectLibrariesAndLink(artifact, libraries) const linkedBytecode = await collectLibrariesAndLink(artifact, libraries)
//@ts-ignore //@ts-ignore
return new ethers.ContractFactory(artifact.abi, linkedBytecode || artifact.bytecode, signer || (new ethers.providers.Web3Provider(remixProvider)).getSigner()) return new ethers.ContractFactory(artifact.abi, linkedBytecode || artifact.bytecode, signer || web3Provider.getSigner())
} }
const getContractAtFromArtifact = async (artifact: any, address: string, signerOrOptions = null) => { const getContractAtFromArtifact = async (artifact: any, address: string, signerOrOptions = null) => {

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-analyzer", "name": "@remix-project/remix-analyzer",
"version": "0.5.34-alpha.6", "version": "0.5.34-alpha.10",
"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.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-astwalker": "^0.0.55-alpha.6", "@remix-project/remix-astwalker": "^0.0.55-alpha.10",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"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": "a046bcad1c8fee07e1b32314af14ae859c66b760", "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c",
"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.55-alpha.6", "version": "0.0.55-alpha.10",
"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.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"@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": "a046bcad1c8fee07e1b32314af14ae859c66b760", "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c",
"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.25-alpha.6", "version": "0.5.25-alpha.10",
"description": "Tool to debug Ethereum transactions", "description": "Tool to debug Ethereum transactions",
"contributors": [ "contributors": [
{ {
@ -26,10 +26,10 @@
"@ethereumjs/tx": "^4.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-astwalker": "^0.0.55-alpha.6", "@remix-project/remix-astwalker": "^0.0.55-alpha.10",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"@remix-project/remix-simulator": "^0.2.25-alpha.6", "@remix-project/remix-simulator": "^0.2.25-alpha.10",
"@remix-project/remix-solidity": "^0.5.11-alpha.6", "@remix-project/remix-solidity": "^0.5.11-alpha.10",
"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": "a046bcad1c8fee07e1b32314af14ae859c66b760", "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c",
"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.25-alpha.6", "version": "0.5.25-alpha.10",
"description": "Library to various Remix tools", "description": "Library to various Remix tools",
"contributors": [ "contributors": [
{ {
@ -51,6 +51,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": "a046bcad1c8fee07e1b32314af14ae859c66b760", "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-simulator", "name": "@remix-project/remix-simulator",
"version": "0.2.25-alpha.6", "version": "0.2.25-alpha.10",
"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.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"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",
@ -67,6 +67,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": "a046bcad1c8fee07e1b32314af14ae859c66b760", "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c",
"types": "./src/index.d.ts" "types": "./src/index.d.ts"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-solidity", "name": "@remix-project/remix-solidity",
"version": "0.5.11-alpha.6", "version": "0.5.11-alpha.10",
"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.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"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": "a046bcad1c8fee07e1b32314af14ae859c66b760" "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-tests", "name": "@remix-project/remix-tests",
"version": "0.2.25-alpha.6", "version": "0.2.25-alpha.10",
"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.0.2", "@ethereumjs/tx": "^4.0.2",
"@ethereumjs/util": "^8.0.3", "@ethereumjs/util": "^8.0.3",
"@ethereumjs/vm": "^6.3.0", "@ethereumjs/vm": "^6.3.0",
"@remix-project/remix-lib": "^0.5.25-alpha.6", "@remix-project/remix-lib": "^0.5.25-alpha.10",
"@remix-project/remix-simulator": "^0.2.25-alpha.6", "@remix-project/remix-simulator": "^0.2.25-alpha.10",
"@remix-project/remix-solidity": "^0.5.11-alpha.6", "@remix-project/remix-solidity": "^0.5.11-alpha.10",
"@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": "a046bcad1c8fee07e1b32314af14ae859c66b760" "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-url-resolver", "name": "@remix-project/remix-url-resolver",
"version": "0.0.47-alpha.6", "version": "0.0.47-alpha.10",
"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": "a046bcad1c8fee07e1b32314af14ae859c66b760" "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-ws-templates", "name": "@remix-project/remix-ws-templates",
"version": "1.0.12-alpha.6", "version": "1.0.12-alpha.10",
"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": "^1.5.1" "web3": "^1.5.1"
}, },
"gitHead": "a046bcad1c8fee07e1b32314af14ae859c66b760" "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c"
} }
Loading…
Cancel
Save