-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BCI-3898: fix multisig set config bug (#497)
- Loading branch information
1 parent
6620d55
commit 27d7d0f
Showing
8 changed files
with
83 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import fs from 'fs' | ||
import { CONTRACT_TYPES, getRDD } from '../rdd' | ||
import { Dependencies } from '../dependencies' | ||
|
||
export const tryToWriteLastConfigDigestToRDD = async ( | ||
deps: Pick<Dependencies, 'logger' | 'prompt'>, | ||
rddPath: string, | ||
contractAddr: string, | ||
configDigest: string, | ||
) => { | ||
deps.logger.info(`lastConfigDigest to save in RDD: ${configDigest}`) | ||
if (rddPath) { | ||
const rdd = getRDD(rddPath) | ||
// set updated lastConfigDigest | ||
rdd[CONTRACT_TYPES.AGGREGATOR][contractAddr]['config']['lastConfigDigest'] = configDigest | ||
fs.writeFileSync(rddPath, JSON.stringify(rdd, null, 2)) | ||
deps.logger.success( | ||
`RDD file ${rddPath} has been updated! You must reformat RDD by running ./bin/degenerate and ./bin/generate in that exact order`, | ||
) | ||
} else { | ||
deps.logger.warn( | ||
`No RDD file was inputted, you must manually update lastConfigDigest in RDD yourself`, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './address' | ||
export * from './configDigest' |