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

Bug fixes discovered during testing. #40

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

montera82
Copy link
Contributor

@montera82 montera82 commented Aug 16, 2023

@montera82 montera82 changed the title mc fix. Bug fixes discovered during testing. Aug 19, 2023
Copy link
Member

@aaronmgdr aaronmgdr left a comment

Choose a reason for hiding this comment

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

the gasLimit + tx.value should not be added together as they are different units of measurement

@montera82 montera82 marked this pull request as ready for review September 6, 2023 15:50
@vercel
Copy link

vercel bot commented Sep 11, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gas-snap-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2023 7:27pm

}

console.log('tx.feeCurrency', tx.feeCurrency);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like a debug log

const network = await getNetworkConfig();
const provider = new CeloProvider(network.url);
const keyPair = await getKeyPair(snap, tx.from);
const wallet = new CeloWallet(keyPair.privateKey).connect(provider);
tx.from = tx.from ? tx.from : wallet.address;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why this line was added.

If tx.from does not exist, than wallet cannot be generated, since keypair is using tx.from

If tx.from could in some cases be missing, should there be a check before line 44 that tx.from actually exist?

export const REJECTION_MESSAGE = 'User rejected the request';
export const INVALID_CURRENCY_MESSAGE = 'Invalid Currency';
export const INSUFFICIENT_FUNDS_MESSAGE = `Insufficient funds for the provided gas currency to complete the operation. Please try again using another currency.`;
export const VALID_CURRENCIES = ['cusd', 'ceur', 'creal', 'celo'];
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: It's usually been convention to write these currencies in uppercase.

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.

Snap Testing bugs
3 participants