Skip to content

Commit

Permalink
Split tokens from imported scripts with new lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjson committed Sep 5, 2024
1 parent 833002d commit 3d48221
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActiveDialog } from '../../../state/types';
import { createInsecureUuidV4 } from '../../../utils';
import { toConventionalId } from '../../common';

import { disassembleBytecodeBCH, hexToBin } from '@bitauth/libauth';
import { disassembleBytecodeBch, hexToBin } from '@bitauth/libauth';
import {
Button,
Classes,
Expand All @@ -16,7 +16,7 @@ import {
import { WarningSign } from '@blueprintjs/icons';
import React, { useState } from 'react';

const disassembleHex = (hex: string) => disassembleBytecodeBCH(hexToBin(hex));
const disassembleHex = (hex: string) => disassembleBytecodeBch(hexToBin(hex));
const tokenizeHex = (hex: string) => {
const splitAtErrors = disassembleHex(hex).split('[');
return [
Expand Down Expand Up @@ -151,7 +151,10 @@ export const ImportScriptDialog = ({
id: scriptId,
internalId: createInsecureUuidV4(),
type: 'isolated',
contents: disassembleHex(bytecode).split('[')[0],
contents: disassembleHex(bytecode)
.split('[')[0]!
.split(' ')
.join('\n'),
});
closeDialog();
}
Expand Down

0 comments on commit 3d48221

Please sign in to comment.