-
Notifications
You must be signed in to change notification settings - Fork 86
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
Remove contract hex encoding #480
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #480 +/- ##
==========================================
- Coverage 61.23% 61.11% -0.13%
==========================================
Files 26 26
Lines 3312 3312
==========================================
- Hits 2028 2024 -4
- Misses 1112 1116 +4
Partials 172 172
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code lgtm, but what is the release strategy here? This will break a lot of code right?
I could add alternative methods with usage of string instead to make a smooth transition? |
I think we can make this non-breaking change: onflow/sdks#18 (comment) |
templates/accounts_test.go
Outdated
require.Less(t, argumentsSize, len(testContractBody)*2+500, | ||
"The create account argument size should not grow over "+ | ||
"2 times the contract code (converted to hex) + 500 bytes of extra data.") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here should be fixed for non-hex case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it already checks utf8 contract length to be below the limit.
Nice! @janezpodhostnik Why would this be a breaking change? |
@janezpodhostnik the only potential breaking point I see for existing contracts already deployed in hex format. Kindly help me to understand if I miss anything here. |
Looking at this again... yeah sorry I thought this was a breaking change, but I see that we are only using fields already on the Contract object. |
I think the sdks dependency actually needs to be bumped for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think onflow/sdks
needs a dependency bump
templates/accounts_test.go
Outdated
@@ -50,7 +48,7 @@ func TestCreateAccount(t *testing.T) { | |||
argumentsSize += len(argument) | |||
} | |||
require.Less(t, txSize, 1000, "The create account script should not grow over 1kB.") | |||
require.Less(t, argumentsSize, contractLen*2+500, | |||
require.Less(t, argumentsSize, len(testContractBody)+500, | |||
"The create account argument size should not grow over "+ | |||
"2 times the contract code (converted to hex) + 500 bytes of extra data.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message needs updating as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated :)
updated, kindly check latest commits. |
I think this PR needs to be merged and release first before updating: onflow/sdks#18 @turbolent can you confirm? |
@chasefleming @turbolent updated from master. Kindly check 🙏 |
@nozim That PR I linked was not merged or released yet so updating from master would not actually address the issue. |
Closes: #467
Description
For contributor use:
master
branchFiles changed
in the Github PR explorer