Skip to content

Commit

Permalink
Merge pull request #106 from near/sign-corrections
Browse files Browse the repository at this point in the history
Sign corrections
  • Loading branch information
esaminu authored Nov 7, 2023
2 parents 602b660 + 1eb01d2 commit 96feec1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/Sign/Sign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface TransactionDetails {
export const calculateGasLimit = (actions) => actions
.filter((a) => Object.keys(a)[0] === 'functionCall')
.map((a) => a.functionCall.gas)
.reduce((totalGas, gas) => totalGas.add(gas), new BN(0))
.reduce((totalGas, gas) => totalGas.add(gas), new BN(0)).div(new BN('1000000000000'))
.toString();

function Sign() {
Expand Down Expand Up @@ -257,12 +257,12 @@ function Sign() {
<TableContent
// eslint-disable-next-line
key={i}
leftSide={transactionDetails.receiverId}
leftSide={transactionDetails.transactions[i].receiverId}
hasFunctionCall
isFunctionCallOpen
rightSide={formatActionType(action.enum)}
functionDesc={<pre>{JSON.stringify(action, null, 2)}</pre>}
openLink={`${network.explorerUrl}/accounts/${transactionDetails.receiverId}`}
functionDesc={action.functionCall.args}
openLink={`${network.explorerUrl}/accounts/${transactionDetails.transactions[i].receiverId}`}
/>
))}
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/TableContent/TableContent.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const TableContentWrapper = styled.div.attrs<check>(({ hasFunctionCall }) => {
background-color: #f9f9f8;
padding: 12px;
overflow-wrap: anywhere;
width: 100%;
}
.left-side {
Expand Down
7 changes: 6 additions & 1 deletion src/components/TableContent/TableContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ function TableContent({
)}
</div>
{isFunctionCallOpen && functionDesc && methodDetails ? (
<div className="function-desc">{functionDesc}</div>
<div className="function-desc">
<pre>
Arguments:&nbsp;
{JSON.stringify(JSON.parse(Buffer.from(functionDesc).toString()), null, 2)}
</pre>
</div>
) : null}
</TableContentWrapper>
);
Expand Down

0 comments on commit 96feec1

Please sign in to comment.