Part of #2191, this issue seeks to gather known work remaining for the upcoming releases:
This issue should represent that which is blocking release, generally related to interface concerns and documentation. This issue constitutes outstanding tasks listed in #2485 and #2467, as well as from informal discussion.
鈩癸笍 Docs preview
_(current as of bf4a50389e7989501090ebdbae3e287015e9842c)_
[x] Ensure completeness of module comments / interface comments / etc. (anything that gets its own page). (_These can be minimal in most cases_)
Style notes: most comments are written in subject-dropped indicative mood, where the subject is the module in question (probably best to follow that convention)
[x] Review docs for usage of TypeDoc categories to group index listings.
Note on usage: @category must be added to the symbol declaration; marking the export doesn't work
[x] Edit values-vs-errors distinction to mention overlong arrays / overlarge pointers
[x] Finish various docs entrypoints
packages/codec/README.md (codec repository readme)packages/decoder/README.md (decoder repository readme)[x] Add usage notes/example for ResultInspector
[x] ~Determine feasibility of modifying the TypeDoc theme's display of async functions (to differentiate them more clearly from regular functions~
@truffle/codec and never a submoduleallocate/typesCodec.*.{Allocate|Decode|Encode} as appropriatestate() return a ContractValue, after appropriate changes to the type? (@haltman-at's current thinking: No)contractKind be a mandatory field on ContractType? (@haltman-at's current thinking: No)additionalContexts argument, so public methods exclude mention of internal argument.read, and make bytes to contain read/bytes as well as parts of what's currently in decode/basicTruffleArtifact maybe?)Note: I'm hoping my new docs written for redo-interface address point no. 2 somewhat.
Claiming the protected and nativize points.
Took a look at it, and I'm calling "Determine feasibility of modifying the TypeDoc theme's display of async functions (to differentiate them more clearly from regular functions" out of scope because of difficulty
OK. What do you think of me going through and just manually marking all the async functions with bold notices?
I added "Add usage notes/example for ResultInspector" since there's nothing there now, but we probably need something, since we point users in that direction.
I added "Add usage notes/example for ResultInspector" since there's nothing there now, but we probably need something, since we point users in that direction.
OK, I can add those.
Docs will have permanent URL at https://www.trufflesuite.com/docs/truffle/codec
Just wanted to document where and how Web3.js is used within @truffle/decoder (@truffle/codec only uses web3-utils which is relatively lightweight). The intention is to find out how coupled we are with Web3.js and whether or not it is feasible to decouple from it.
Based on commit 98ae40e3ef2ee729f1d5d227dcb0ea92b90db60d.
utils.tsWeb3.utils.toChecksumAddress(value);
index.tsLine 156 the Provider constructor from Web3.js is used:
import { Provider } from "web3/providers";
Line 231 the forContract() function accepts a variable contract where it expects a nested web3 object to grab the currentProvider:
return await forArtifact(contract, contract.web3.currentProvider, artifacts);
types.tsThe structure of the following interfaces are informed by Web3.js object structures:
LogDecodedLogTransactionLine 255 the ContractConstructorObject interface includes a web3 instance inside of it.
decoders.tsweb3.eth.getCode(address, block)web3.eth.getBlock(block))web3.eth.getPastLogs({ address, fromBlock, toBlock })web3.eth.net.getId()web3.utils.isAddress(address)web3.utils.toChecksumAddress(address)web3.eth.getBlockNumber()web3.eth.getBalance(address, blockNum)web3.eth.getTransactionCount(address, blockNum)web3.eth.getStorageAt(address, slot, block)@adrianmcli thank you so much for the thorough digging and record-keeping!
we did 'em