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

Chores #274

Merged
merged 3 commits into from
May 16, 2022
Merged

Chores #274

merged 3 commits into from
May 16, 2022

Conversation

AlicanC
Copy link
Contributor

@AlicanC AlicanC commented May 14, 2022

fix: repo scripts

Days since someone got rekt by not having set -euo pipefail: 0

We didn't have set -euo pipefail in our .sh files so we weren't noticing one of the contracts was failing to build. (The reason was the forgotten lib-std and lib-core dependencies.) I've fixed the issue and also added set -euo pipefail to all of our .sh files.

fix: coder type

maturity was previously typed u32 and was later changed to u64. We forgot some and didn't notice because we encode them the same.

chore: replace hardcoded script with actual Sway code

This one replaces our hardcoded contract call script with an actual Sway script. It's a hacky script but we can improve it as Sway allows us to.

This should also get us closer to #216

@AlicanC AlicanC changed the title Jc/chores Chores May 15, 2022
@AlicanC AlicanC self-assigned this May 15, 2022
@AlicanC AlicanC added the feat Issue is a feature label May 15, 2022
@AlicanC AlicanC marked this pull request as ready for review May 15, 2022 01:08
@@ -63,7 +63,7 @@ export class TransactionScriptCoder extends Coder {
parts.push(new NumberCoder('gasPrice', 'u64').encode(value.gasPrice));
parts.push(new NumberCoder('gasLimit', 'u64').encode(value.gasLimit));
parts.push(new NumberCoder('bytePrice', 'u64').encode(value.bytePrice));
parts.push(new NumberCoder('maturity', 'u32').encode(value.maturity));
parts.push(new NumberCoder('maturity', 'u64').encode(value.maturity));
Copy link
Member

Choose a reason for hiding this comment

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

I think we should keep it as spec even if the decoder results in the same 8 bytes. https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/tx_format.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. I thought we changed maturity to u64. There are other places where we type maturity u64 so I've opened an issue to fix this completely: #275

Let's keep this change though so at least all maturities are u64 instead of only one being u32.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, this fixes a bug and we need it because the JS type is bigint and this returns number.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@AlicanC AlicanC merged commit 59cbeff into master May 16, 2022
@AlicanC AlicanC deleted the jc/chores branch May 16, 2022 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants