Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support log transaction from iframe plugin #4245

Merged
merged 2 commits into from
Nov 19, 2023

Conversation

drafish
Copy link
Contributor

@drafish drafish commented Nov 15, 2023

I'm developing an iframe plugin for xinghuo bif, and I want to send a transaction log, and I got some issues.

Here is the first one.

image
Check the code here - https://github.com/ethereum/remix-project/blob/master/libs/remix-ui/terminal/src/lib/components/Context.tsx#L19

provider will be missing if the transaction log is called from iframe plugin.

Here is another one.

The decoded input does not convert correctly when it's BigNumber.
image
Here is the correct convert result.
image
BigNumber will turn to a ordinary object if it's passed through postMessage.

@Aniket-Engg @ryestew

Copy link

netlify bot commented Nov 15, 2023

👷 Deploy request for remixproject pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 7ad1b68

@@ -116,7 +116,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
}
scriptRunnerDispatch({
type: message.type ? message.type : 'log',
payload: { message: [message.value] },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do that here.
What are the input parameters?
You could have a default behavior when provider is not present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is an example of input parameters. @yann300

{
  type: 'knownTransaction',
  value: {
    tx: {
      hash: resp.detail.hash,
      isCall: false,
      blockNumber: resp.detail.ledger_seq,
      transactionCost: resp.detail.actual_fee,
      from: resp.detail.transaction.source_address,
      to: null,
      transactionIndex: resp.detail.transaction.nonce,
    },
    receipt: { status: '0x1', contractAddress: resp.detail.contractAddress },
    resolvedData: {
      contractName: selectedContract.name,
      to: null,
      fn: '(constructor)',
      params: eventsDecoder._decodeInputParams(getinputParameters(data.dataHex.replace(data.contractBytecode, '')), txHelper.getConstructorInterface(selectedContract.abi)),
      contractAddress: resp.detail.contractAddress,
    },
    logs: logs,
  },
  provider: 'bif',
}

@yann300 yann300 merged commit da0fa7e into ethereum:master Nov 19, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants