Skip to content

Commit

Permalink
Merge pull request #108 from paraswap/feat/epoch-43-and-fix
Browse files Browse the repository at this point in the history
fix: shape for DB-storing script
  • Loading branch information
alexshchur authored Jan 29, 2024
2 parents f36cc1a + c81174a commit f44baa5
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function storeDistributionDataInDB(
) {
const {
root: { epoch, merkleRoot, totalAmount },
leaves,
merkleProofs,
} = merkleTree;

await database.sequelize?.transaction(async t => {
Expand All @@ -29,14 +29,9 @@ export async function storeDistributionDataInDB(
},
);

const epochDataToUpdate: GasRefundParticipantData[] = leaves.map(
const epochDataToUpdate: GasRefundParticipantData[] = merkleProofs.map(
(leaf: GasRefundMerkleProof) => {
const {
address: account,
merkleProofs,
amount,
GRPChainBreakDown,
} = leaf;
const { address: account, proof, amount, GRPChainBreakDown } = leaf;
assert(
account == account.toLowerCase(),
`LOGIC ERROR: ${account} should be lowercased`,
Expand All @@ -45,7 +40,7 @@ export async function storeDistributionDataInDB(
epoch,
address: account,
chainId: chainId,
merkleProofs,
merkleProofs: proof,
isCompleted: true,
amount,
GRPChainBreakDown,
Expand Down

0 comments on commit f44baa5

Please sign in to comment.