Skip to content

Conversation

gaurangtorvekar
Copy link
Collaborator

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment on lines 382 to 411
/** Schedule delete of a Flora account (AccountDeleteTransaction). */
export function buildHcs16ScheduleAccountDeleteTx(params: {
floraAccountId: string;
transferAccountId: string;
memo?: string;
}): ScheduleCreateTransaction {
const inner = new AccountUpdateTransaction() as any; // AccountDeleteTransaction not imported in current SDK typings set
// Fallback: construct via new proto if needed in future; here we use typed import when available
// Replace when AccountDeleteTransaction is exported in the used SDK version
(inner as any).setAccountId?.(AccountId.fromString(params.floraAccountId));
if (params.memo) {
(inner as any).setTransactionMemo?.(params.memo);
}
(inner as any).setTransferAccountId?.(
AccountId.fromString(params.transferAccountId),
);
return new ScheduleCreateTransaction().setScheduledTransaction(inner);

Choose a reason for hiding this comment

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

P1 Badge Schedule delete uses AccountUpdateTransaction so no deletion occurs

The new buildHcs16ScheduleAccountDeleteTx builds the scheduled transaction from an AccountUpdateTransaction and conditionally calls setTransferAccountId and other delete-only setters via optional chaining. Because AccountUpdateTransaction does not implement these methods, none of them execute and the scheduled transaction ends up as an empty account update rather than an AccountDeleteTransaction. Any call to scheduleFloraDeletion will therefore submit a schedule that never deletes the Flora account and omits the mandatory transfer account, causing execution to fail. Use a proper AccountDeleteTransaction (or construct the delete proto directly) so the schedule actually performs an account deletion.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this

@kantorcodes
Copy link
Member

kantorcodes commented Oct 14, 2025

@gaurangtorvekar it looks like the DCO check is still failing. Either the GPG key is not working or -s was not used with the commits. You might have to do a squash / rebase

const pub = await this.mirrorNode.getPublicKey(accountId);
// Enforce ECDSA: ED25519 keys are not supported for Flora membership
const pubStr = pub.toString();
if (
Copy link
Member

Choose a reason for hiding this comment

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

floraAccountId: string;
profileResource: string;
}): Promise<TransactionReceipt> {
const tx = new AccountUpdateTransaction()
Copy link
Member

Choose a reason for hiding this comment

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

We should have this transaction generated in tx.ts - the main reason we started doing this recently is so standards-agent-kit can reuse a transaction assembled in the right format without executing it immediately for use of the builder pattern.

floraAccountId: string;
profile: FloraProfile | any;
}): Promise<{ profileResource: string; receipt: TransactionReceipt }> {
const result = await params.hcs11.inscribeProfile(params.profile as any);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need type any here, should we be enforcing the profile shape with zod?

src/hcs-16/tx.ts Outdated

let transactionMemo: string | undefined;
if (
typeof params.opCode === 'number' &&
Copy link
Member

Choose a reason for hiding this comment

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

Zod could be good for these type checks too potentially

@gaurangtorvekar gaurangtorvekar force-pushed the feat/hcs-16-full-implementation branch from 1c5871d to d0e12cc Compare October 15, 2025 10:47
@gaurangtorvekar
Copy link
Collaborator Author

@kantorcodes Made changes as per your comments, and now the DCO check is also passing

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.

2 participants