Skip to content

Commit b988036

Browse files
committed
add bytecode size to artifact details
1 parent a20a7e9 commit b988036

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "my-cashscript-playground",
2+
"name": "cashscript-playground",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
@@ -9,6 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"@cashscript/utils": "^0.11.0-next.2",
1213
"@emotion/react": "^11.14.0",
1314
"@emotion/styled": "^11.14.0",
1415
"@monaco-editor/react": "^3.6.2",

src/components/ArtifactsInfo.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import { Artifact } from 'cashscript'
3+
import { asmToBytecode } from '@cashscript/utils'
34
import { Button } from 'react-bootstrap'
45
import FileUploader from './FileUploader'
56

@@ -89,6 +90,7 @@ const ArtifactsInfo: React.FC<Props> = ({ setCode, artifacts, setArtifacts }) =>
8990
<strong>Last Updated</strong>
9091
<p>{artifact.updatedAt.split('T')[0]} {artifact.updatedAt.split('T')[1].slice(0,5)}</p>
9192
<strong>Artifact Bytecode</strong>
93+
<div>Bytecode size: {asmToBytecode(artifact.bytecode).length } bytes (without constructor args)</div>
9294
<details>
9395
<summary>
9496
show full Bytecode

0 commit comments

Comments
 (0)