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

add prefix to user address when processing flow.json #1331

Merged
merged 9 commits into from
Jan 10, 2024

Conversation

bthaile
Copy link
Contributor

@bthaile bthaile commented Jan 5, 2024

Closes: #1330

Description

add prefix to user address when processing flow.json


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov-commenter
Copy link

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (63643d1) 40.24% compared to head (741c1d7) 40.16%.

Files Patch % Lines
internal/super/flix.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1331      +/-   ##
==========================================
- Coverage   40.24%   40.16%   -0.08%     
==========================================
  Files          40       40              
  Lines        2152     2156       +4     
==========================================
  Hits          866      866              
- Misses       1189     1193       +4     
  Partials       97       97              
Flag Coverage Δ
unittests 40.16% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@chasefleming chasefleming left a comment

Choose a reason for hiding this comment

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

There should be a Go SDK utility to do this. I think it's HexToAddress

Copy link
Collaborator

@bjartek bjartek left a comment

Choose a reason for hiding this comment

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

I think address has a Hex method that will do this.

Copy link
Member

@chasefleming chasefleming left a comment

Choose a reason for hiding this comment

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

Just a heads up, this file is getting close to needing some tests

@chasefleming
Copy link
Member

@bthaile looks like lint step didn't pass

@bthaile
Copy link
Contributor Author

bthaile commented Jan 8, 2024

Just a heads up, this file is getting close to needing some tests

#1335
created this ticket to track adding unit tests. I've moved a lot of the complexity to flixkit-go itself, I do agree flix.go needs tests.

@bthaile
Copy link
Contributor Author

bthaile commented Jan 8, 2024

I think address has a Hex method that will do this.

Hex() does not include "0x" that I see, maybe it's how I'm printing out the string fmt.Println or fmt.Sprintf doesn't print out a leading "0x"

@bthaile
Copy link
Contributor Author

bthaile commented Jan 8, 2024

Hex() does not include "0x" that I see, maybe it's how I'm printing out the string fmt.Println or fmt.Sprintf doesn't print out a leading "0x"

Hex() does not include "0x" that I see, maybe it's how I'm printing out the string fmt.Println or fmt.Sprintf doesn't print out a leading "0x". I changed to use BytesToAddress to create a flow.Address address := flow.BytesToAddress([]byte(addr))

@chasefleming
Copy link
Member

@bthaile Can you create an issue in Go SDK if there is no method available for what you need so it's available in the future for others? You can also also make the PR to the Go SDK so we are avoiding hardcoding.

@bthaile
Copy link
Contributor Author

bthaile commented Jan 9, 2024

@bthaile Can you create an issue in Go SDK if there is no method available for what you need so it's available in the future for others? You can also also make the PR to the Go SDK so we are avoiding hardcoding.

flow-go-sdk, added issue and PR.
onflow/flow-go-sdk#554

Any other blockers on this PR? This PR won't need to use the new convenience method for the PR I just created.

@bthaile
Copy link
Contributor Author

bthaile commented Jan 9, 2024

I think address has a Hex method that will do this.

nope Hex() does not add "0x" I used Hex() in my PR anyway. PR is good to go.

@bthaile bthaile merged commit fd943af into master Jan 10, 2024
5 checks passed
@bthaile bthaile deleted the add-prefix-address branch January 10, 2024 17:23
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.

User address missing prefix generating FLIX for local environment
4 participants