Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: P-927 refactor brc20 contract to configure tokens and networks #2900

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

higherordertech
Copy link
Contributor

in a unified place, remove redundant network loops in function queryBalance in TokenQueryLogic, move url config to dp client

Context

Labels

Please apply following PR-related labels when appropriate:

  • C0-breaking: if your change could break the existing client, e.g. API change, critical logic change
  • C1-noteworthy: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvement

How (Optional)

Testing Evidences

Please attach any relevant evidences if applicable

I will have follow up PR to test the new bitcoin network type via cli tests.

Copy link

linear bot commented Jul 16, 2024

…n a unified place, remove redundant network loops in function queryBalance in TokenQueryLogic, move url config to dp client
}
}
// Mark this network as queried
queriedNetworks[networks[i]] = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should queriedNetworks mapping be removed here? If the network is bsc and ethereum, what I mean is when execute param is :

identities = [

{

identity_type: 4,

value: "0xf7764F15Fd4F695fAD8dDd3e84F5293E6866FEFE",

networks: [7, 8],

},

]

in this case, will it be queried twice here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said, same identity could has different networks, but we need sum the token balance from different network.
e.g.

  1. There has an evm identity A has 2 networks ethereum and bsc.
  2. We need generate TokenHoldingAmount VC for token TRX.
  3. The total balance of token TRX for identity A is: (TRX token balance in network ethereum) + (TRX token balance in network bsc).

@higherordertech higherordertech requested review from 0xverin, kziemianek and a team July 16, 2024 06:05
@higherordertech higherordertech enabled auto-merge (squash) July 16, 2024 06:06
@higherordertech higherordertech merged commit 26acdc2 into dev Jul 16, 2024
32 checks passed
@Kailai-Wang Kailai-Wang deleted the refactor-BRC20 branch July 16, 2024 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants