Skip to content

Commit ab5aae7

Browse files
pivilartisantphoebe
andauthored
Fix: setGlobalMetadata coins estm (#240)
Co-authored-by: phoebe <[email protected]>
1 parent 9faeabe commit ab5aae7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

cli/src/lib/website/metadata.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,10 @@ export async function setGlobalMetadata(
8484
address: string,
8585
metadatas: Metadata[]
8686
): Promise<Operation> {
87-
const storedGlobalMetadata = await getGlobalMetadata(provider, address)
88-
const changedKeys = metadatas.filter(
89-
(metadata) =>
90-
!storedGlobalMetadata.some(
91-
(storedMetadata) => storedMetadata.key === metadata.key
92-
)
93-
)
87+
const { updateRequired } = await divideMetadata(provider, address, metadatas)
88+
9489
const encoder = new TextEncoder()
95-
const coins = changedKeys.reduce(
90+
const coins = updateRequired.reduce(
9691
(sum, metadata) =>
9792
sum +
9893
storageCostForEntry(

0 commit comments

Comments
 (0)