pull/5298/head
yann300 2 months ago committed by Aniket
parent f89f6f4dbe
commit f7bd13b9f8
  1. 4
      apps/remix-ide/src/blockchain/providers/vm.ts
  2. 16
      libs/remix-ui/run-tab/src/lib/components/account.tsx
  3. 6
      libs/remix-ui/workspace/src/lib/actions/index.tsx
  4. 6
      libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx

@ -39,8 +39,8 @@ export class VMProvider {
return new Promise((resolve, reject) => {
this.worker.addEventListener('message', (msg) => {
if (msg.data.cmd === 'sendAsyncResult' && stamps[msg.data.stamp]) {
let result = msg.data.result
if (stamps[msg.data.stamp].request && msg.data.result) result = msg.data.result.result
const result = msg.data.result
// if (stamps[msg.data.stamp].request && msg.data.result) result = msg.data.result.result
if (stamps[msg.data.stamp].callback) {
stamps[msg.data.stamp].callback(msg.data.error, result)

@ -178,19 +178,19 @@ export function AccountUI(props: AccountProps) {
<div className='mt-2'>
<span>otherwise</span><button className='ml-2 modal-ok btn btn-sm border-primary' data-id="sign-eip-712" onClick={() => {
props.modal(
'Message signing with EIP-712',
'Message signing with EIP-712',
<div>
<div>{intl.formatMessage({ id: 'udapp.EIP712-2' }, {
a: (chunks) => (
<a href='https://eips.ethereum.org/EIPS/eip-712' target="_blank" rel="noreferrer">
{chunks}
</a>
)
})}</div>
a: (chunks) => (
<a href='https://eips.ethereum.org/EIPS/eip-712' target="_blank" rel="noreferrer">
{chunks}
</a>
)
})}</div>
<div>{intl.formatMessage({ id: 'udapp.EIP712-3' })}</div></div>,
intl.formatMessage({ id: 'udapp.EIP712-create-template' }),
() => { props.addFile('EIP-712-data.json', JSON.stringify(EIP712_Example, null, '\t')) },
intl.formatMessage({ id: 'udapp.EIP712-close' }),
intl.formatMessage({ id: 'udapp.EIP712-close' }),
() => {})
}}>Sign with EIP 712</button>
</div>

@ -512,21 +512,21 @@ export const runScript = async (path: string) => {
export const signTypedData = async (path: string) => {
const typedData = await plugin.call('fileManager', 'readFile', path)
const web3 = await plugin.call('blockchain', 'web3')
const settings = await plugin.call('udapp', 'getSettings')
const settings = await plugin.call('udapp', 'getSettings')
let parsed
try {
parsed = JSON.parse(typedData)
} catch (err) {
dispatch(displayPopUp(`${path} isn't a valid JSON.`))
return
}
}
try {
const result = await web3.currentProvider.request({
method: 'eth_signTypedData',
params: [settings.selectedAccount, parsed]
})
plugin.call('terminal', 'log', { type: 'log', value: `${path} signature using ${settings.selectedAccount} : ${result}` })
} catch (e) {
console.error(e)

@ -234,11 +234,11 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
case 'Publish Workspace to Gist':
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'publishWorkspace'])
publishFolderToGist(path)
break
case 'Sign Typed Data':
break
case 'Sign Typed Data':
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'signTypedData'])
signTypedData(path)
break
break
default:
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', `${item.id}/${item.name}`])
emit && emit({ ...item, path: [path]} as customAction)

Loading…
Cancel
Save