Skip to content

Commit

Permalink
fix: return type and rename calldata
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkelawala committed Nov 1, 2022
1 parent 1f8711d commit 67fe081
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion __tests__/udc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ describe('Declare and UDC Deploy Flow', () => {
test('UDC Deploy', async () => {
const deployment = await account.deploy({
classHash: erc20ClassHash,
callData: [encodeShortString('Token'), encodeShortString('ERC20'), account.address],
constructorCalldata: [
encodeShortString('Token'),
encodeShortString('ERC20'),
account.address,
],
salt: '123',
unique: true, // Using true here so as not to clash with normal erc20 deploy in account and provider test
isDevnet: IS_DEVNET,
Expand Down
10 changes: 5 additions & 5 deletions src/account/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ export class Account extends Provider implements AccountInterface {
classHash,
salt,
unique = true,
callData = [],
constructorCalldata = [],
isDevnet = false,
}: UniversalDeployerContractPayload,
transactionsDetail: InvocationsDetails = {}
): Promise<any> {
const compiledCallData = compileCalldata(callData);
): Promise<InvokeFunctionResponse> {
const compiledConstructorCallData = compileCalldata(constructorCalldata);
return this.execute(
{
contractAddress: isDevnet ? UDC.ADDRESS_DEVNET : UDC.ADDRESS,
Expand All @@ -252,8 +252,8 @@ export class Account extends Provider implements AccountInterface {
classHash,
salt,
toCairoBool(unique),
compiledCallData.length,
...compiledCallData,
compiledConstructorCallData.length,
...compiledConstructorCallData,
],
},
undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/types/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type UniversalDeployerContractPayload = {
classHash: BigNumberish;
salt: string;
unique: boolean;
callData?: RawArgs;
constructorCalldata?: RawArgs;
isDevnet?: boolean;
};

Expand Down

0 comments on commit 67fe081

Please sign in to comment.