remove the use of toolcommand from generate-deploy-script

This commit is contained in:
Edmond Lee 2020-05-26 11:14:47 -07:00
parent a4831a05e7
commit dba6335bfc
4 changed files with 3 additions and 36 deletions

View File

@ -4,13 +4,12 @@ import styled from 'styled-components';
import { AppState } from '../../redux/app'; import { AppState } from '../../redux/app';
import { import {
ChangeCommandAction,
ChangeEntrypointAction, ChangeEntrypointAction,
ChangeStorageAction, ChangeStorageAction,
ChangeToolAction, ChangeToolAction,
GenerateDeployScriptState, GenerateDeployScriptState,
} from '../../redux/generate-deploy-script'; } 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 { AccessFunctionLabel, Group, Input, Label, Textarea } from '../form/inputs';
import { Option, Select } from '../form/select'; import { Option, Select } from '../form/select';
@ -25,10 +24,6 @@ export const GenerateDeployScriptPane = () => {
state => state.generateDeployScript.tool state => state.generateDeployScript.tool
); );
const command = useSelector<AppState, GenerateDeployScriptState['command']>(
state => state.generateDeployScript.command
);
const entrypoint = useSelector<AppState, GenerateDeployScriptState['entrypoint']>( const entrypoint = useSelector<AppState, GenerateDeployScriptState['entrypoint']>(
state => state.generateDeployScript.entrypoint state => state.generateDeployScript.entrypoint
); );
@ -49,16 +44,6 @@ export const GenerateDeployScriptPane = () => {
<Option value={Tool.TezosClient}>Tezos Client</Option> <Option value={Tool.TezosClient}>Tezos Client</Option>
</Select> </Select>
</Group> </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> <Group>
<AccessFunctionLabel htmlFor="entrypoint"></AccessFunctionLabel> <AccessFunctionLabel htmlFor="entrypoint"></AccessFunctionLabel>
<Input <Input

View File

@ -82,7 +82,7 @@ export class GenerateDeployScriptAction extends CancellableAction {
const title = slugify(editor.title).toLowerCase() || 'untitled'; const title = slugify(editor.title).toLowerCase() || 'untitled';
const output = `tezos-client \\ const output = `tezos-client \\
${generateDeployScript.command} \\ originate \\
contract \\ contract \\
${title} \\ ${title} \\
transferring 0 \\ transferring 0 \\

View File

@ -1,16 +1,14 @@
import { ActionType as ExamplesActionType, ChangeSelectedAction as ChangeSelectedExampleAction } from './examples'; import { ActionType as ExamplesActionType, ChangeSelectedAction as ChangeSelectedExampleAction } from './examples';
import { Tool, ToolCommand } from './types'; import { Tool } from './types';
export enum ActionType { export enum ActionType {
ChangeTool = 'generate-deploy-script-change-tool', ChangeTool = 'generate-deploy-script-change-tool',
ChangeCommand = 'generate-deploy-script-change-command',
ChangeEntrypoint = 'generate-deploy-script-change-entrypoint', ChangeEntrypoint = 'generate-deploy-script-change-entrypoint',
ChangeStorage = 'generate-deploy-script-change-storage' ChangeStorage = 'generate-deploy-script-change-storage'
} }
export interface GenerateDeployScriptState { export interface GenerateDeployScriptState {
tool: Tool; tool: Tool;
command: ToolCommand;
entrypoint: string; entrypoint: string;
originationAccount: string; originationAccount: string;
storage: string; storage: string;
@ -22,11 +20,6 @@ export class ChangeToolAction {
constructor(public payload: GenerateDeployScriptState['tool']) {} constructor(public payload: GenerateDeployScriptState['tool']) {}
} }
export class ChangeCommandAction {
public readonly type = ActionType.ChangeCommand;
constructor(public payload: GenerateDeployScriptState['command']) {}
}
export class ChangeEntrypointAction { export class ChangeEntrypointAction {
public readonly type = ActionType.ChangeEntrypoint; public readonly type = ActionType.ChangeEntrypoint;
constructor(public payload: GenerateDeployScriptState['entrypoint']) {} constructor(public payload: GenerateDeployScriptState['entrypoint']) {}
@ -39,14 +32,12 @@ export class ChangeStorageAction {
type Action = type Action =
| ChangeToolAction | ChangeToolAction
| ChangeCommandAction
| ChangeEntrypointAction | ChangeEntrypointAction
| ChangeStorageAction | ChangeStorageAction
| ChangeSelectedExampleAction; | ChangeSelectedExampleAction;
const DEFAULT_STATE: GenerateDeployScriptState = { const DEFAULT_STATE: GenerateDeployScriptState = {
tool: Tool.TezosClient, tool: Tool.TezosClient,
command: ToolCommand.Originate,
entrypoint: '', entrypoint: '',
storage: '', storage: '',
originationAccount: '', originationAccount: '',
@ -68,11 +59,6 @@ export default (
...state, ...state,
tool: action.payload tool: action.payload
}; };
case ActionType.ChangeCommand:
return {
...state,
command: action.payload
};
case ActionType.ChangeEntrypoint: case ActionType.ChangeEntrypoint:
return { return {
...state, ...state,

View File

@ -16,7 +16,3 @@ export enum Command {
export enum Tool { export enum Tool {
TezosClient = 'tezos-client' TezosClient = 'tezos-client'
} }
export enum ToolCommand {
Originate = 'originate'
}