- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Sep 5 2023
Sep 4 2023
@bytesofman, @tobias_ruck - ready for your follow up review following Fabien's acceptance, pls see updated summary for reference on this refactored state.
Re-ordering unit test public function
- Moved FailoverProxy and the Endpoint interface into its own file failoverProxy.ts
- The Endpoint interface is only used within failoverProxy.ts hence not declared as an export
Responding to feedback
Responding to feedback
Sep 2 2023
- Renamed Proxy interface to Endpoint to reflect it having regular and ws endpoints
- Renamed FailoverProxy class to Proxy
- Dropped underscore in _get and _post
Sep 1 2023
Updated mock API calls to async
Aug 31 2023
- Moved _post, _get, _request and _callAxios into the FailoverProxy class.
- Created a new connectWs() function in FailoverProxy and originally tried passing WsEndpoint._connect() to it as a callback function param, however none of the internal WsEndpoint variables carried over causing all kinds of issues. Instead, I moved the logic from WsEndpoint._connect() into FailoverProxy.connectWs(), passing this as an input param so everything it needs is accessible from execution within FailoverProxy.
- ScriptEndpoint now takes in FailoverProxy as an input param rather than a ChronikClient instance.
- Removed moveWorkingIndexToFront() function and corresponding unit tests.
- I also looked into making a separate diff for FailoverProxy as per earlier suggestion but the fact that it needs the cycling refactor makes it not that much different to this current diff.
Aug 30 2023
Removed script error mocks
- Added tests to mock API errors for utxos(), history() and script().
- Updated package.json
- Removed npm installation instructions in README. Kept package.json as it's needed for the unit test suite and potential inclusion in CI.
- Renamed chronikMock.js to index.js, and chronikMock.test.js to index.test.js
- Updated apps/examples/sendXec.test.js to use this chronik mock to show script(), utxos() and broadcastTx() endpoints working fine. Couldn't use ecash-coinselect as an example because its current state in master does not make API calls.
Aug 29 2023
Comment below for discussion.
Aug 28 2023
Waiting on D14418 to land
Added ecashaddjr to package.json
@TODO: need to add ChronikMock in a separate diff in order to mock the chronik.script().utxos() api call within getInputUtxos().
- Renamed the existing getInputUtxos() function into getP2pkhInputUtxos(), along with README and commenting updates to make it clear this function ONLY takes in p2pkh utxos. Similarly updated mock names to reflect this.
- Added new 'getInputUtxos() function that is similar to getP2pkhInputUtxos() except it takes in an eCash address, converts it to hash160 and makes the chronik.script(type, hash).utxos()` call directly before parsing the result.
- Due to the similarity between getP2pkhInputUtxos() and 'getInputUtxos(), the common logic has been moved into a new function called collectXecUtxos()`.
- @TODO: need to add ChronikMock in a separate diff in order to mock the chronik.script().utxos() api call within getInputUtxos().
Aug 27 2023
Added cycling logic which can be summarized as:
- When ChronikClient._request() or WsEndpoint._connect() successfully connects to a regular or ws endpoint, its index in the proxy array is passed to FailoverProxy's moveWorkingIndexToFront() function which moves that element to the front of the array so that it will be used first at the next connection attempt.
- Since each element contains a pairing of the regular url endpoint and its wsUrl equivalent, cycling through the array will always ensure both endpoint types are synchronized.
- Added unit tests for appendWsUrls, FailoverProxy instance and moveWorkingIndexToFront().
Aug 26 2023
(Incremental update - still work in progress)
Just for info, current thinking on the proposed FailoverProxy class.
Rebased to master
Aug 25 2023
Backed out OP_RETURN related logic, leaving only the bytecount calculation fixes
Added isWithinByteCountRange function
Updated unit tests to reflect byte size calculations
Aug 24 2023
Responding to feedback
Updated README
Aug 23 2023
Responding to feedback
Fixed typo
Added contextual comments around:
- Max outputs per tx and its corresponding varint encoding
- Max inputs per tx and its corresponding varint encoding
- ECDSA signature breakdown and the smallest valid scriptSig
- Min and max OP_RETURN output sizes
Aug 22 2023
In D14380#322891, @Fabien wrote:In D14380#322888, @emack wrote:Updated constants in P2PKH_OUT_SIZE and FRAMEWORK_BYTES calculations to factor in whether outputs and inputs are less than 253 which uses 1 byte for storage length, or >= 253 which uses 3 bytes for storage length.
What about larger var ints ?
Updated constants in P2PKH_OUT_SIZE and FRAMEWORK_BYTES calculations to factor in whether outputs and inputs are less than 253 which uses 1 byte for storage length, or >= 253 which uses 3 bytes for storage length.
What is your source ?
I got it from https://bitcointalk.org/index.php?topic=4429991.0
@Fabien ping
Responding to feedback
Aug 17 2023
The output count is not limited to 252
So is it basically the max possible amount of outputs in a single tx multiplied by the locking script size?
Aug 16 2023
In D14380#322425, @Fabien wrote:Do you mean the variable-length integer encoding the locking script's size is not 1 byte?
Yes: https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer
In D14351#322389, @Fabien wrote:You should unit test getInputUtxos with the new changes, better in its own diff. I can already spot a bug related to varint encoding in calcByteCount so there might be more.
Aug 15 2023
Is it OK to subscribe to some backend ws but use another of for the regular endpoints?
@tobias_ruck - this can technically be done but would it be advisable based on how you designed this client?
Rebased to master
Updated function comments
Rebase to master
Updated bytecount logic
Updated getSlpInputUtxos to calculate the OP_RETURN script as a Buffer, and then calls getInputUtxos using the length of this Buffer. The resulting txFee calculation now factors in the OP_RETURN bytecount.
Note: the slpMdm library is what's used by Cashtab to generate OP_RETURN scripts as well.
Aug 13 2023
Removed the try/catch in _connect() and instead updated the onerror callback to close the websocket., which results in the loop cycling to the next url in this._wsUrls.
Rebase
Responding to feedback
Updated to use .isNeg()
should actually go in wallet state
Will wait to see the decision around potentially moving pending logic to alias-server before making this change
- Fixed cashtabCache refresh trigger dependency by also updating the cashtabCache state variable in useWallet, which now successfully refreshes the Alias.js component on new alias registrations and changes to pending aliases list
- Added notification on successful or unsuccessful alias registeration in useWallet's pendingAliasCheck function
Aug 12 2023
Rebase
Rebase
Removed debugging statement
Responding to feedback
I think this diff needs to be rebuilt with a simpler approach.
Aug 11 2023
Looks like this got inadvertently merged into part 2 - D14352 when rebasing to changes from part 1
Updated usage instructions
Updated README
Looks like this got inadvertently merged into part 2 - D14352 when rebasing to changes from part 1
Rebased to changes in part 1
Rebased to changes in part 1
Updated SLP quantities to use bn.js
Note: the logic to trigger notification on successful and unsuccessful registrations will be done in a separate diff to help with ease of reviewing this diff.
Updated comments
Responding to feedback
In D14356#321936, @Fabien wrote:
- red: registered by someone else