Merge branch 'webide/generate-deploy-script' into 'dev'

webide / generate deploy script updates

See merge request ligolang/ligo!653
This commit is contained in:
Jev Björsell 2020-06-02 22:10:06 +00:00
commit dc17676447
10 changed files with 52 additions and 37 deletions

View File

@ -16,6 +16,7 @@
entrypoint: add entrypoint: add
parameters: 5, 6 parameters: 5, 6
generateDeployScript: generateDeployScript:
tool: tezos-client
entrypoint: main entrypoint: main
storage: 0 storage: 0
*_*) *_*)

View File

@ -62,6 +62,22 @@
name_price=0tez; name_price=0tez;
skip_price=333mutez skip_price=333mutez
} }
generateDeployScript:
tool: tezos-client
entrypoint: main
storage: |
{
identities=Big_map.literal[
(1,
{owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869}
);
];
next_id=2;
name_price=10tez;
skip_price=333mutez
}
*_*) *_*)
type id = int type id = int

View File

@ -16,6 +16,7 @@
entrypoint: add entrypoint: add
parameters: (5, 6) parameters: (5, 6)
generateDeployScript: generateDeployScript:
tool: tezos-client
entrypoint: main entrypoint: main
storage: 0 storage: 0
*_*) *_*)

View File

@ -60,6 +60,21 @@
skip_price=333mutez; skip_price=333mutez;
] ]
) )
generateDeployScript:
tool: tezos-client
entrypoint: main
storage: |
record [
identities=big_map[
1->record
[owner=("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address);
controller=("tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" : address);
profile=0x0501000000026869]
];
next_id=2;
name_price=0tez;
skip_price=50mutez;
]
*_*) *_*)
type id is int type id is int

View File

@ -16,6 +16,7 @@
entrypoint: add entrypoint: add
parameters: (5, 6) parameters: (5, 6)
generateDeployScript: generateDeployScript:
tool: tezos-client
entrypoint: main entrypoint: main
storage: 0 storage: 0
*_*) *_*)

View File

@ -60,6 +60,20 @@
skip_price:333mutez skip_price:333mutez
} }
) )
generateDeployScript:
tool: tezos-client
entrypoint: main
storage: |
{
identities:Big_map.literal([
(1,
{owner:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx" : address), controller:("tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx": address), profile:0x0501000000026869}
)
]),
next_id:2,
name_price:10tez,
skip_price:333mutez
}
*_*) */ *_*) */
type id = int type id = int

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'
}