Skip to content

Commit

Permalink
Add simulation ID to DB json (#286)
Browse files Browse the repository at this point in the history
Sometimes its nice to have a reference to an existing simulation.
  • Loading branch information
bh2smith authored May 22, 2023
1 parent 53dc7b9 commit 191deb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal_transfers/actions/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export function jsonFromSettlementData(datum: SimulationData): object {
logs: datum.logs,
blockNumber: datum.blockNumber,
ethDelta: bigIntMapToJSON(datum.ethDelta),
simId: datum.simulationID,
};
}

Expand Down
3 changes: 3 additions & 0 deletions internal_transfers/actions/tests/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ describe("All Database Tests", () => {
const expected = [
{
complete: {
simId: "sim-id",
blockNumber: blockNumber,
ethDelta: bigIntMapToJSON(exampleEthDelta),
logs: [exampleLog, exampleLog],
},
reduced: {
simId: "sim-id",
blockNumber: blockNumber,
ethDelta: bigIntMapToJSON(exampleEthDelta),
logs: [exampleLog],
Expand Down Expand Up @@ -423,6 +425,7 @@ describe("jsonFromSettlementData", () => {
ethDelta: new Map([["0x1", bigNumber]]),
};
expect(jsonFromSettlementData(dummySimData)).toStrictEqual({
simId: "sim-id",
blockNumber: 1,
ethDelta: {
"0x1": bigNumber.toString(),
Expand Down

0 comments on commit 191deb3

Please sign in to comment.