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

Some additional test to verify ecrecovery with TxId and coin witness #495

Merged
merged 1 commit into from
Jun 18, 2023

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Jun 15, 2023

@luizstacio is working on the predicate, and he tried to recover the signer public key from the witness and TxId. These tests verify the behavior for the script and predicate on the fuel-vm side.

@xgreenx xgreenx requested a review from a team June 15, 2023 20:38
@xgreenx xgreenx self-assigned this Jun 15, 2023
Copy link
Member

@Dentosal Dentosal left a comment

Choose a reason for hiding this comment

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

LGTM; I'm a bit surprised we didn't have tests of this already but it's good to add them now.

op::gtf_args(0x22, 0x00, GTFArgs::WitnessData),
// TxId is stored in the first 32 bytes of the memory
// Store it into register 0x23
op::movi(0x23, 0),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: registers are zeroed already on initialization

// 0x10 contains the size of the public key = PublicKey::LEN
op::movi(0x10, PublicKey::LEN as Immediate18),
op::aloc(0x10),
op::move_(0x11, RegId::HP),
Copy link
Member

Choose a reason for hiding this comment

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

Nit: assigning to a register is not needed, RegId::HP could be used directly in place of 0x11 after this.

@xgreenx
Copy link
Collaborator Author

xgreenx commented Jun 18, 2023

It is to make the test case more clear=D

@xgreenx xgreenx added this pull request to the merge queue Jun 18, 2023
Merged via the queue into master with commit e69e733 Jun 18, 2023
@xgreenx xgreenx deleted the feature/some-tests-ecrecovery-and-tx-id branch June 18, 2023 21:42
@xgreenx xgreenx mentioned this pull request Jul 13, 2023
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