Skip to content

feat: support create method in AppClient #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: fix/deploy_error_parsing
Choose a base branch
from

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented May 20, 2025

Main driver behind this change is allowing the factory to use an app client to reduce duplicated code

I've now realized I've deleted some methods that are public, so we might have to add those back in to prevent MAJOR version bump. Will keep in draft until that is done

Main driver behind this change is allowing the factory to use an app
client to reduce duplicated code
@joe-p joe-p force-pushed the refactor/app_client_in_deployer branch from 815ffcc to 483b80f Compare May 20, 2025 20:32
@@ -1222,6 +1239,9 @@ export class AppClient {
update: async (params?: AppClientBareCallParams & AppClientCompilationParams) => {
return this._algorand.createTransaction.appUpdate(await this.params.bare.update(params))
},
create: async (params?: AppClientBareCallParams & AppClientCompilationParams) => {
return this._algorand.createTransaction.appCreate(await this.params.bare.update(params))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be create rather than update?

} else {
composer.addAppDelete({ appId: existingApp.appId, ...deleteParams })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes (in a few places) deliberate? In general I was pretty careful about ordering of spreading but it’s possible I got some wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes because we are now getting the params from the app client's params methods, which include the app ID of the client. Previously there was no app ID being passed in deleteParams. The order needed to be changed to ensure we use the app ID the deployer resolves, not the one in the AppClient

@aorumbayev
Copy link
Contributor

Just my 2c, If any of these would change higher level interfaces exposed to end user, would just like to remind that utils py would have to be upgraded as well.
Also would recommend checking the behaviour with client generators py|ts to see if any changes would need introduction into typed version of factory or client that get auto generated.

@@ -260,9 +261,9 @@ export interface FundAppAccountParams {
/** Source maps for an Algorand app */
export interface AppSourceMaps {
/** The source map of the approval program */
approvalSourceMap: SourceMapExport
approvalSourceMap: algosdk.ProgramSourceMap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be extending reliance on algosdk types externally which I'm not sure we want to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. Didn't realize the SDK used a class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants