-
Notifications
You must be signed in to change notification settings - Fork 1
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
(VDB-366) Add sin mapping to vow storage transformer #51
Conversation
if err != nil { | ||
return nil, err | ||
} | ||
encodedBytes := hexutil.EncodeUint64(uint64(intTimestamp)) |
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 hex stuff is just the first way I found to convert an int to a byte array, not sure if there's a clearer or more idiomatic way of going about it.
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.
Could you also do something like this: []byte(timestamp)
to convert the timestamp string into a byte array?
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.
Weirdly no, that doesn't work (I get a different array)... so I guess my initial comment was wrong, I must not just be converting an int to a byte array. I'm gonna dig in a little bit and figure out exactly what's happening in this function
@@ -43,11 +43,15 @@ var FakeHeader = core.Header{ | |||
} | |||
|
|||
func GetFakeHeader(blockNumber int64) core.Header { | |||
return GetFakeHeaderWithTimestamp(fakeTimestamp, blockNumber) |
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 haven't made this change in vulcanizedb yet, it's part of a PR I'm about to open
this change is now a very small PR in vulcanizedb. I'll copy-paste it into vendors before merging
It's merged in now
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.
🚀
752f9cc
to
466422e
Compare
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.
LGTM! A couple of small questions, that aren't merge blocking.
db.MustExec("DELETE FROM maker.vow_sin_integer") | ||
db.MustExec("DELETE FROM maker.vow_sump") | ||
db.MustExec("DELETE FROM maker.vow_vat") | ||
db.MustExec("DELETE FROM maker.vow_wait") |
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.
🎉
if err != nil { | ||
return nil, err | ||
} | ||
encodedBytes := hexutil.EncodeUint64(uint64(intTimestamp)) |
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.
Could you also do something like this: []byte(timestamp)
to convert the timestamp string into a byte array?
transformers/storage/vow/mappings.go
Outdated
return nil | ||
} | ||
|
||
func getSinKey(timestamp string) common.Hash { |
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.
Is this string the hex representation of the timestamp? I wonder if it would be helpful to specify that in the var name, like hexTimestamp
or something?
466422e
to
3ef1f49
Compare
I think this is just about right. Still have a couple questions though