Skip to content

Commit

Permalink
Merge main into release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jul 12, 2024
2 parents b17bada + f243dd1 commit 1714989
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
26 changes: 17 additions & 9 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,15 +635,23 @@ export function blockDataToBlockMetadata(blockData: BlockData): BlockMetadata {
txnCounter: block.tc,
transactionsRoot: block.txn ? Buffer.from(block.txn).toString('base64') : 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
transactionsRootSha256: block.txn256,
upgradeVote: {
upgradeApprove: block.upgradeyes,
upgradeDelay: block.upgradedelay,
upgradePropose: block.upgradeprop,
},
participationUpdates: {
absentParticipationAccounts: block.partupdabs?.map((addr) => algosdk.encodeAddress(addr)),
expiredParticipationAccounts: block.partupdrmv?.map((addr) => algosdk.encodeAddress(addr)),
},
...(block.upgradeyes !== undefined || block.upgradedelay !== undefined || block.upgradeprop !== undefined
? {
upgradeVote: {
upgradeApprove: block.upgradeyes,
upgradeDelay: block.upgradedelay,
upgradePropose: block.upgradeprop,
},
}
: undefined),
...(block.partupdabs !== undefined || block.partupdrmv !== undefined
? {
participationUpdates: {
absentParticipationAccounts: block.partupdabs?.map((addr) => algosdk.encodeAddress(addr)),
expiredParticipationAccounts: block.partupdrmv?.map((addr) => algosdk.encodeAddress(addr)),
},
}
: undefined),
stateProofTracking: block.spt
? Object.entries(block.spt).map(([key, value]) => ({
nextRound: value.n,
Expand Down
9 changes: 0 additions & 9 deletions tests/scenarios/transform-complex-txn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ describe('Complex transaction with many nested inner transactions', () => {
"genesisId": "mainnet-v1.0",
"hash": "EOq+HX242/G/ADonU6q5lfimxX7twuFKEwtG4rDt+kI=",
"parentTransactionCount": 55,
"participationUpdates": {
"absentParticipationAccounts": undefined,
"expiredParticipationAccounts": undefined,
},
"previousBlockHash": "8ReLxqOPxmuKuBfACtllRRr13n2E2r01f8wXt3vFYW0=",
"rewards": {
"feeSink": "Y76M3MSY6DKBRHBL7C3NNDXGS5IIMQVQVUAB6MP4XEMMGVF2QWNPL226CA",
Expand Down Expand Up @@ -335,11 +331,6 @@ describe('Complex transaction with many nested inner transactions', () => {
"nextProtocolSwitchOn": 35275315,
"nextProtocolVoteBefore": 35125315,
},
"upgradeVote": {
"upgradeApprove": undefined,
"upgradeDelay": undefined,
"upgradePropose": undefined,
},
},
]
`)
Expand Down

0 comments on commit 1714989

Please sign in to comment.