Skip to content

Commit

Permalink
chore: copy metadata before mutate and warn user to update web with n…
Browse files Browse the repository at this point in the history
…ew hash
  • Loading branch information
kaladinlight committed Jul 25, 2024
1 parent a2515a2 commit 222e670
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const processEpoch = async () => {

const nextEpochStartDate = new Date(metadata.epochEndTimestamp + 1)

const hash = await ipfs.updateMetadata(metadata, {
const hash = await ipfs.updateMetadata(Object.assign({}, metadata), {
epoch: { number: metadata.epoch, hash: epochHash },
metadata: {
epoch: metadata.epoch + 1,
Expand All @@ -104,6 +104,9 @@ const processEpoch = async () => {
info(
'Please update the rFOX Wiki (https://github.com/shapeshift/rFOX/wiki/rFOX-Metadata) and notify the DAO accordingly. Thanks!',
)
warn(
'Important: CURRENT_EPOCH_METADATA_IPFS_HASH must be updated in web (https://github.com/shapeshift/web/blob/develop/src/pages/RFOX/constants.ts).',
)
}

const run = async () => {
Expand Down Expand Up @@ -171,6 +174,9 @@ const update = async () => {
info(
'Please update the rFOX Wiki (https://github.com/shapeshift/rFOX/wiki/rFOX-Metadata) and notify the DAO accordingly. Thanks!',
)
warn(
'Important: CURRENT_EPOCH_METADATA_IPFS_HASH must be updated in web (https://github.com/shapeshift/web/blob/develop/src/pages/RFOX/constants.ts).',
)
}

const processDistribution = async (metadata: RFOXMetadata, epoch: Epoch, wallet: Wallet, ipfs: IPFS) => {
Expand Down

0 comments on commit 222e670

Please sign in to comment.