Skip to content

Commit

Permalink
Fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 committed Oct 24, 2023
1 parent 8a56763 commit ca95cc2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/components/workspace/ABIUi/ABIUi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const ABIUi: FC<Props> = ({
abi.name,
contract as any,
language,
abi?.kind,
stack as any,
network
);
Expand Down Expand Up @@ -109,7 +110,7 @@ const ABIUi: FC<Props> = ({
className={s.formItemABI}
rules={[{ required: true, message: 'Please input value' }]}
>
<Input placeholder={`${item.name}:${item.type}`} />
<Input placeholder={`${item.name}: ${item.type}`} />
</Form.Item>
</div>
))}
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/contract.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export function useContractAction() {
methodName: string,
contract: SandboxContract<UserContract> | null = null,
language: ContractLanguage,
kind?: string,
stack?: TupleItem[],
network?: Network | Partial<NetworkEnvironment>
) {
Expand All @@ -203,9 +204,12 @@ export function useContractAction() {

const sender = sandboxWallet!!.getSender();

let messageParams = {
let messageParams: any = {
$$type: methodName,
};
if (kind === 'text') {
messageParams = methodName;
}
stack?.forEach((item: any) => {
messageParams = {
...messageParams,
Expand All @@ -231,6 +235,7 @@ export function useContractAction() {
methodName: string,
contract: SandboxContract<UserContract> | null = null,
language: ContractLanguage,
kind?: string,
stack?: TupleItem[],
network?: Network | Partial<NetworkEnvironment>
) {
Expand Down
11 changes: 10 additions & 1 deletion src/hooks/project.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,15 @@ export function useProjectActions() {
if (item.message.type === 'Deploy') {
return;
}
if (item.message.type) {
if (item.message.kind) {
if (item.message.kind !== 'typed') {
setters.push({
name: item.message.text,
parameters: [],
kind: item.message.kind,
});
return;
}
const singleItem = (output.abi as any).types.find(
(type: any) => type.name === item.message.type
);
Expand All @@ -236,6 +244,7 @@ export function useProjectActions() {
type: parameter.type.type,
format: parameter.type.format,
optional: parameter.type.optional,
kind: item.message.kind,
};
}),
};
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/workspace.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface ABIParameter {

export interface ABIField {
name: string;
kind: string;
parameters: ABIParameter[];
arguments: ABIParameter[];
returnTypes: ABIParameter;
Expand Down

0 comments on commit ca95cc2

Please sign in to comment.