Page MenuHomePhabricator

[Cashtab] [airdrop chronik for mint address p1] Get minting address with chronik and compare to bch-api result
ClosedPublic

Authored by bytesofman on Oct 25 2022, 17:37.

Details

Summary

T2730

This is part 1 of a stacked diff to remove a bch-api call from Airdrop.js

In this part, chronik is used to calculate the same information (i.e. the minting address). A console.log statement confirms that both methods get the same result.

The rest of this stack will deprecate the bch-api approach and remove debug logging.

Test Plan

npm start
Create an aidrop tx and hit the switch for 'Ignore eToken minter address', hit 'Calculate Airdrop' button
Observe the dev console for Chronik and bch-api got the same minting address statement
Confirm you get the same result for a handful of different token ids

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested changes to this revision.Oct 26 2022, 01:08
emack added a subscriber: emack.
emack added inline comments.
web/cashtab/src/components/Airdrop/Airdrop.js
265–288 ↗(On Diff #35995)

I can envision other use cases down the line needing to use this logic to retrieve info on the creator of a type1 or nft token. Can you move this into its own utility function in cashMethods and add a corresponding unit test?
Something like getTokenCreatorAddress() passing in chronik instance and token ID.

This revision now requires changes to proceed.Oct 26 2022, 01:08

Moving chronik approach into its own function with unit tests

Using correct bchObj vs BCH

This revision is now accepted and ready to land.Oct 27 2022, 02:49