This part updates block related code to use NeoRest. It also fixes types, reduces duplicate data passing around and clarifies props.
specifically;
requestBlockSuccess() expected a Block type while the reducer and consuming component (N3BlockTransactionsList) expected a DetailedBlock type. Now they all expect DetailedBlock
Updated DetailedBlock to have a type specification for the tx field
Dropped list from N3BlockTransactionsList props and all functions consuming it later on because the same data is in the block prop under the tx field.
the indexOrHash field in most block actions was actually always the block index as a string (could have been necessary when there was still N2 code, now it isn't). I renamed the field to make more sense now. Also the /v2/ backend can only request a block by index using NeoRest.block() not by hash. Which is probably why they started using this manual fetching (await fetch(`${GENERATE_BASE_URL()}/block/${indexOrHash}`))
This part updates
block
related code to use NeoRest. It also fixes types, reduces duplicate data passing around and clarifies props.specifically;
requestBlockSuccess()
expected aBlock
type while the reducer and consuming component (N3BlockTransactionsList
) expected aDetailedBlock
type. Now they all expectDetailedBlock
DetailedBlock
to have a type specification for thetx
fieldlist
fromN3BlockTransactionsList
props and all functions consuming it later on because the same data is in theblock
prop under thetx
field.indexOrHash
field in most block actions was actually always the block index as a string (could have been necessary when there was still N2 code, now it isn't). I renamed the field to make more sense now. Also the/v2/
backend can only request a block by index usingNeoRest.block()
not by hash. Which is probably why they started using this manual fetching (await fetch(`${GENERATE_BASE_URL()}/block/${indexOrHash}`)
)