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

Transfer becomes TransferCoin in typescript type check #1923

Merged
merged 8 commits into from
May 12, 2022
Merged

Conversation

stella3d
Copy link
Contributor

Explorer frontend broke because of this name change, this adds more flexibility to the type check.

To test, npm start the explorer and navigate to:
http://localhost:3000/transactions/NoDwmf3WZfUfjLugQwQ7FHq%2F6KgawS9935zND%2FhA3as%3D/?rpc=http%3A%2F%2Fade208279c6c444e5bf8b852fca5411d-1692910544.us-west-2.elb.amazonaws.com%3A9000%2F

this was previously broken.

This was also causing issues with only showing a few recent transactions on the home page, which should show 15 again.
http://localhost:3000/?rpc=http%3A%2F%2Fade208279c6c444e5bf8b852fca5411d-1692910544.us-west-2.elb.amazonaws.com%3A9000%2F

@stella3d stella3d self-assigned this May 12, 2022
recipient: string;
object_ref: RawObjectRef;
};
export type RawAuthoritySignInfo = [AuthorityName, AuthoritySignature];

export type TransactionKindName = 'Transfer' | 'Publish' | 'Call';
export type TransactionKindName = 'Transfer' | 'TransferCoin' | 'Publish' | 'Call';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type TransactionKindName = 'Transfer' | 'TransferCoin' | 'Publish' | 'Call';
export type TransactionKindName = 'TransferCoin' | 'Publish' | 'Call';

I would rather keep this in sync with the backend schema, rather than worrying about backward compatibility since this makes the codebase very messy. We will have a devnet release today, so the devnet gateway server should also return TransferCoin soon

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would too, but i fear that may break the existing deployment - when we redeploy, will that remove all old objects ?

Comment on lines 15 to 16
| { TransferCoin: TransferCoin }
| { Transfer: TransferCoin }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| { TransferCoin: TransferCoin }
| { Transfer: TransferCoin }
| { TransferCoin: TransferCoin }

const tx = getSingleTransactionKind(data);
return tx && 'Transfer' in tx ? tx.Transfer : undefined;
if (!tx) return undefined;
if ('Transfer' in tx) return tx.Transfer;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ('Transfer' in tx) return tx.Transfer;

@stella3d
Copy link
Contributor Author

removed backwards compat

@longbowlu
Copy link
Collaborator

let's fix the lint complaints and I will cherry pick this into devnet release

@stella3d
Copy link
Contributor Author

not sure why the e2e tests are failing when nothing in the UI has changed...

@apburnie
Copy link
Contributor

Note that this PR changes the layout of the Transaction Results.

Layout on Main:

image

Layout on this branch

image

@stella3d
Copy link
Contributor Author

the PR does not change the layout: this is caused by pointing the new frontend at the old data model.

This reverts commit ae32d2f.
@stella3d stella3d merged commit 9cdbebd into main May 12, 2022
@stella3d stella3d deleted the fix-transfercoin branch May 12, 2022 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants