Skip to content

Commit

Permalink
Merge pull request #107 from autonomys/bug/agent-frame-latest-cid
Browse files Browse the repository at this point in the history
Bug/agent frame latest cid
  • Loading branch information
Xm0onh authored Jan 4, 2025
2 parents 14f66a5 + f8bf4aa commit 076998f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export const getLastMemoryHash = async (): Promise<string> => {

export const getLastMemoryCid = async (): Promise<string> => {
const lastMemoryHash = await contract.getLastMemoryHash(wallet.address);
// Convert hex string to Buffer
if (!lastMemoryHash) {
return '';
}
const hashBuffer = Buffer.from(lastMemoryHash.slice(2), 'hex');

const cid = cidFromBlakeHash(hashBuffer);
Expand All @@ -27,5 +29,6 @@ export const setLastMemoryHash = async (hash: string, nonce?: number) => {
nonce: nonce,
gasLimit: 100000,
});
const _receipt = await tx.wait();
return tx;
};
1 change: 0 additions & 1 deletion auto-agents-framework/src/agents/tools/utils/dsnUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export async function uploadToDsn(data: object) {
compression: true,
password: config.autoDriveConfig.AUTO_DRIVE_ENCRYPTION_PASSWORD || undefined,
});
logger.info('Upload to Dsn - Uploaded CID', { uploadedCid }, stringToCid(uploadedCid));

const blake3hash = blake3HashFromCid(stringToCid(uploadedCid));
logger.info('Setting last memory hash', {
Expand Down

0 comments on commit 076998f

Please sign in to comment.