remove the use of toolcommand from generate-deploy-script
This commit is contained in:
parent
a4831a05e7
commit
dba6335bfc
@ -4,13 +4,12 @@ import styled from 'styled-components';
|
||||
|
||||
import { AppState } from '../../redux/app';
|
||||
import {
|
||||
ChangeCommandAction,
|
||||
ChangeEntrypointAction,
|
||||
ChangeStorageAction,
|
||||
ChangeToolAction,
|
||||
GenerateDeployScriptState,
|
||||
} from '../../redux/generate-deploy-script';
|
||||
import { Tool, ToolCommand } from '../../redux/types';
|
||||
import { Tool } from '../../redux/types';
|
||||
import { AccessFunctionLabel, Group, Input, Label, Textarea } from '../form/inputs';
|
||||
import { Option, Select } from '../form/select';
|
||||
|
||||
@ -25,10 +24,6 @@ export const GenerateDeployScriptPane = () => {
|
||||
state => state.generateDeployScript.tool
|
||||
);
|
||||
|
||||
const command = useSelector<AppState, GenerateDeployScriptState['command']>(
|
||||
state => state.generateDeployScript.command
|
||||
);
|
||||
|
||||
const entrypoint = useSelector<AppState, GenerateDeployScriptState['entrypoint']>(
|
||||
state => state.generateDeployScript.entrypoint
|
||||
);
|
||||
@ -49,16 +44,6 @@ export const GenerateDeployScriptPane = () => {
|
||||
<Option value={Tool.TezosClient}>Tezos Client</Option>
|
||||
</Select>
|
||||
</Group>
|
||||
<Group>
|
||||
<Label>Command</Label>
|
||||
<Select
|
||||
id="tool-command"
|
||||
value={command}
|
||||
onChange={value => dispatch({ ...new ChangeCommandAction(value) })}
|
||||
>
|
||||
<Option value={ToolCommand.Originate}>Originate</Option>
|
||||
</Select>
|
||||
</Group>
|
||||
<Group>
|
||||
<AccessFunctionLabel htmlFor="entrypoint"></AccessFunctionLabel>
|
||||
<Input
|
||||
|
@ -82,7 +82,7 @@ export class GenerateDeployScriptAction extends CancellableAction {
|
||||
|
||||
const title = slugify(editor.title).toLowerCase() || 'untitled';
|
||||
const output = `tezos-client \\
|
||||
${generateDeployScript.command} \\
|
||||
originate \\
|
||||
contract \\
|
||||
${title} \\
|
||||
transferring 0 \\
|
||||
|
@ -1,16 +1,14 @@
|
||||
import { ActionType as ExamplesActionType, ChangeSelectedAction as ChangeSelectedExampleAction } from './examples';
|
||||
import { Tool, ToolCommand } from './types';
|
||||
import { Tool } from './types';
|
||||
|
||||
export enum ActionType {
|
||||
ChangeTool = 'generate-deploy-script-change-tool',
|
||||
ChangeCommand = 'generate-deploy-script-change-command',
|
||||
ChangeEntrypoint = 'generate-deploy-script-change-entrypoint',
|
||||
ChangeStorage = 'generate-deploy-script-change-storage'
|
||||
}
|
||||
|
||||
export interface GenerateDeployScriptState {
|
||||
tool: Tool;
|
||||
command: ToolCommand;
|
||||
entrypoint: string;
|
||||
originationAccount: string;
|
||||
storage: string;
|
||||
@ -22,11 +20,6 @@ export class ChangeToolAction {
|
||||
constructor(public payload: GenerateDeployScriptState['tool']) {}
|
||||
}
|
||||
|
||||
export class ChangeCommandAction {
|
||||
public readonly type = ActionType.ChangeCommand;
|
||||
constructor(public payload: GenerateDeployScriptState['command']) {}
|
||||
}
|
||||
|
||||
export class ChangeEntrypointAction {
|
||||
public readonly type = ActionType.ChangeEntrypoint;
|
||||
constructor(public payload: GenerateDeployScriptState['entrypoint']) {}
|
||||
@ -39,14 +32,12 @@ export class ChangeStorageAction {
|
||||
|
||||
type Action =
|
||||
| ChangeToolAction
|
||||
| ChangeCommandAction
|
||||
| ChangeEntrypointAction
|
||||
| ChangeStorageAction
|
||||
| ChangeSelectedExampleAction;
|
||||
|
||||
const DEFAULT_STATE: GenerateDeployScriptState = {
|
||||
tool: Tool.TezosClient,
|
||||
command: ToolCommand.Originate,
|
||||
entrypoint: '',
|
||||
storage: '',
|
||||
originationAccount: '',
|
||||
@ -68,11 +59,6 @@ export default (
|
||||
...state,
|
||||
tool: action.payload
|
||||
};
|
||||
case ActionType.ChangeCommand:
|
||||
return {
|
||||
...state,
|
||||
command: action.payload
|
||||
};
|
||||
case ActionType.ChangeEntrypoint:
|
||||
return {
|
||||
...state,
|
||||
|
@ -16,7 +16,3 @@ export enum Command {
|
||||
export enum Tool {
|
||||
TezosClient = 'tezos-client'
|
||||
}
|
||||
|
||||
export enum ToolCommand {
|
||||
Originate = 'originate'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user