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

Group/v2 #89

Merged
merged 10 commits into from
Dec 27, 2021
Merged

Group/v2 #89

merged 10 commits into from
Dec 27, 2021

Conversation

akileshtangella
Copy link
Contributor

No description provided.

@@ -194,20 +194,24 @@ class Anchor {

// Proposal data is used to update linkedAnchors via bridge proposals
// on other chains with this anchor's state
public async getProposalData(leafIndex?: number): Promise<string> {
public async getProposalData(executionAnchor: Anchor, leafIndex?: number): Promise<string> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should pass in the resourceID rather than the entire Anchor class.

@@ -54,8 +54,8 @@ export class BridgeSide {
*** make its way to the neighbor root of the linked anchor on chain X.
*** @param linkedAnchorInstance: the anchor instance on the opposite chain
***/
public async createAnchorUpdateProposalData(linkedAnchorInstance: Anchor) {
const proposalData = await linkedAnchorInstance.getProposalData();
public async createAnchorUpdateProposalData(linkedAnchorInstance: Anchor, thisAnchorInstance: Anchor) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't a good naming scheme, lets avoid thisAnchorInstance please. Propose other names if you're unsure.

public async createAnchorUpdateProposalData(linkedAnchorInstance: Anchor) {
const proposalData = await linkedAnchorInstance.getProposalData();
public async createAnchorUpdateProposalData(linkedAnchorInstance: Anchor, thisAnchorInstance: Anchor) {
const proposalData = await linkedAnchorInstance.getProposalData(thisAnchorInstance);
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets also just call the get resourceID method and pass that result to the anchor whose state we are fetching.

@drewstone
Copy link
Contributor

There's a lot more to be fixed in these classes @saiakilesh. Naming can certainly be improved and how proposals are created can be improved too.

@drewstone drewstone merged commit 12a14ab into main Dec 27, 2021
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