Skip to content

Commit

Permalink
missed a couple return types
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Jun 22, 2023
1 parent 080e177 commit b26f0f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/common/src/codegen/render-solidity/renderEnums.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { renderArguments, renderList, renderedSolidityHeader } from "./common";
import { RenderEnum } from "./types";

export function renderEnums(enums: RenderEnum[]) {
export function renderEnums(enums: RenderEnum[]): string {
let result = renderedSolidityHeader;

result += renderList(
Expand Down
12 changes: 6 additions & 6 deletions packages/common/src/codegen/render-solidity/renderTypeHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RenderField, RenderKeyTuple, RenderType } from "./types";

export function renderTypeHelpers(options: { fields: RenderField[]; keyTuple: RenderKeyTuple[] }) {
export function renderTypeHelpers(options: { fields: RenderField[]; keyTuple: RenderKeyTuple[] }): string {
const { fields, keyTuple } = options;

let result = "";
Expand Down Expand Up @@ -32,9 +32,9 @@ export function renderTypeHelpers(options: { fields: RenderField[]; keyTuple: Re
return result;
}

function getWrappingHelpers(array: RenderType[]) {
const wrappers = new Map();
const unwrappers = new Map();
function getWrappingHelpers(array: RenderType[]): string[] {
const wrappers = new Map<string, string>();
const unwrappers = new Map<string, string>();
for (const { typeWrappingData, typeWrap, typeUnwrap, internalTypeId } of array) {
if (!typeWrappingData) continue;
const { kind } = typeWrappingData;
Expand All @@ -54,7 +54,7 @@ function renderWrapperStaticArray(
elementType: string,
staticLength: number,
internalTypeId: string
) {
): string {
// WARNING: ensure this still works if changing major solidity versions!
// (the memory layout for static arrays may change)
return `
Expand All @@ -76,7 +76,7 @@ function renderUnwrapperStaticArray(
elementType: string,
staticLength: number,
internalTypeId: string
) {
): string {
// byte length for memory copying (more efficient than a loop)
const byteLength = staticLength * 32;
// TODO to optimize memory usage consider generalizing TightEncoder to a render-time utility
Expand Down

0 comments on commit b26f0f5

Please sign in to comment.