-
Notifications
You must be signed in to change notification settings - Fork 28
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
new coreum_wasm_sdk features (version upgrade) and integration tests #536
new coreum_wasm_sdk features (version upgrade) and integration tests #536
Conversation
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.
Reviewable status: 0 of 27 files reviewed, 1 unresolved discussion (waiting on @keyleu, @miladz68, @silverspase, and @ysv)
integration-tests/modules/testdata/wasm/ft/package/coreum-wasm-sdk/.gitignore
line 1 at r1 (raw file):
.idea
It's possible to import the crate from the git, that's how you can tests that the SDK is valid. Could you please do it and remove the copy, since not clear now what will be left.
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.
Reviewable status: 0 of 27 files reviewed, 2 unresolved discussions (waiting on @keyleu, @miladz68, @silverspase, and @ysv)
a discussion (no related file):
IMO it's a bad idea to mix up those 2 PRs. Not it is'n clear what to review :-(
It would be nice to separate them.
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.
Reviewable status: 0 of 27 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
a discussion (no related file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
IMO it's a bad idea to mix up those 2 PRs. Not it is'n clear what to review :-(
It would be nice to separate them.
base64 is only like 2 lines of code in query.go
integration-tests/modules/testdata/wasm/ft/package/coreum-wasm-sdk/.gitignore
line 1 at r1 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
It's possible to import the crate from the git, that's how you can tests that the SDK is valid. Could you please do it and remove the copy, since not clear now what will be left.
ok will do that
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.
Reviewable status: 0 of 27 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
a discussion (no related file):
Previously, keyleu (Keyne) wrote…
base64 is only like 2 lines of code in query.go
still want me to separate them?
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.
Reviewable status: 0 of 27 files reviewed, 2 unresolved discussions (waiting on @keyleu, @miladz68, @silverspase, and @ysv)
a discussion (no related file):
Previously, keyleu (Keyne) wrote…
still want me to separate them?
But better to split it anyways, for the git history and PRs consistency.
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.
Reviewable status: 0 of 27 files reviewed, 2 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
a discussion (no related file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
But better to split it anyways, for the git history and PRs consistency.
done, removed the base64 changes from here and separated in different PR
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.
Reviewable status: 0 of 27 files reviewed, 6 unresolved discussions (waiting on @keyleu, @miladz68, @silverspase, and @ysv)
integration-tests/modules/contract.go
line 1 at r3 (raw file):
package modules
This file make sence, only if it's located in the modules/testdata/wasm
, but if you do it that way update it for IBC tests as well. But not sure that this file is needed at all.
integration-tests/modules/contract.go
line 14 at r3 (raw file):
//nolint //go:embed testdata/wasm/ft/artifacts/ft.wasm FTWASM []byte
Why the FT is uppercase but bft is lower?
integration-tests/modules/wasm_test.go
line 1172 at r3 (raw file):
royaltyRate := sdk.MustNewDecFromStr("0.1") dataString := "data" databytes, err := base64.StdEncoding.DecodeString(dataString)
Rename that var plz to dataBase64Bytes
or similar since it collides with the dataBytes
variable.
integration-tests/modules/wasm_test.go
line 1172 at r3 (raw file):
royaltyRate := sdk.MustNewDecFromStr("0.1") dataString := "data" databytes, err := base64.StdEncoding.DecodeString(dataString)
Not clear why do you need to Decode the string here. If the fix with the decode/encode on the handler level is correct no extra decoding is needed. Right?
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.
Reviewable status: 0 of 28 files reviewed, 6 unresolved discussions (waiting on @dzmitryhil, @miladz68, @silverspase, and @ysv)
integration-tests/modules/contract.go
line 1 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
This file make sence, only if it's located in the
modules/testdata/wasm
, but if you do it that way update it for IBC tests as well. But not sure that this file is needed at all.
Will modify as agreed
integration-tests/modules/contract.go
line 14 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Why the FT is uppercase but bft is lower?
like we discussed, it's for upgrades.
integration-tests/modules/wasm_test.go
line 1172 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Rename that var plz to
dataBase64Bytes
or similar since it collides with thedataBytes
variable.
will move to the other PR and rename
integration-tests/modules/wasm_test.go
line 1172 at r3 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
Not clear why do you need to Decode the string here. If the fix with the decode/encode on the handler level is correct no extra decoding is needed. Right?
It's for the test class that we compare with, like discussed.
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.
Reviewable status: 0 of 29 files reviewed, all discussions resolved (waiting on @miladz68, @silverspase, and @ysv)
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
integration-tests/upgrade/ft.go
line 28 at r8 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
this comment might be removed
done
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.
Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @miladz68, @silverspase, and @ysv)
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.
Reviewed 3 of 4 files at r7, 4 of 5 files at r8, 3 of 4 files at r10, all commit messages.
Reviewable status: 31 of 32 files reviewed, 3 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewed 1 of 4 files at r10.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)
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.
Reviewed 8 of 27 files at r1, 10 of 12 files at r2, 1 of 1 files at r3, 2 of 5 files at r5, 3 of 4 files at r7, 4 of 5 files at r8, 4 of 4 files at r10, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)
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.
Reviewed 4 of 4 files at r10, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)
* Base64 encoding/decoding * Move data * Add data to compare decode for tests * Encode before * Added data generation
dfbb3df
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.
Reviewable status: 28 of 32 files reviewed, 1 unresolved discussion (waiting on @keyleu, @miladz68, @silverspase, @wojtek-coreum, and @ysv)
integration-tests/modules/wasm_test.go
line 1177 at r11 (raw file):
data[i] = uint8(i) } encodedData := base64.StdEncoding.EncodeToString(data)
You don't need the for. Why you do the make([]byte, 256)
it will fill the bytes slice with the default byte values.
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.
Reviewable status: 28 of 32 files reviewed, all discussions resolved (waiting on @miladz68, @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewed 4 of 4 files at r11, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @keyleu, @silverspase, and @ysv)
integration-tests/upgrade/ft.go
line 170 at r11 (raw file):
}, BurnRate: burnRate.String(), SendCommissionRate: sendCommissionRate.String(),
I don't think it should be needed. We have many unit and integration tests where those values are skipped and they work.
integration-tests/upgrade/ft.go
line 212 at r11 (raw file):
InitialAmount: issuanceAmount.String(), Description: "my wasm fungible token", BurnRate: burnRate.String(),
ditto
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/upgrade/ft.go
line 170 at r11 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
I don't think it should be needed. We have many unit and integration tests where those values are skipped and they work.
If you don't add them you get an error, they are not optional.
integration-tests/upgrade/ft.go
line 212 at r11 (raw file):
Previously, wojtek-coreum (Wojtek) wrote…
ditto
same as above
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/modules/wasm_test.go
line 1177 at r11 (raw file):
Previously, dzmitryhil (Dzmitry Hil) wrote…
You don't need the for. Why you do the
make([]byte, 256)
it will fill the bytes slice with the default byte values.
without the for it provides the same byte value for each element in the vector (0x0). What I want is all the possible byte values.
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
integration-tests/upgrade/ft.go
line 170 at r11 (raw file):
Previously, keyleu (Keyne) wrote…
If you don't add them you get an error, they are not optional.
The error comes from the wasm handler. It throws an ABCI error.
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.
Reviewed 4 of 4 files at r11, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @silverspase, @wojtek-coreum, and @ysv)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @silverspase and @ysv)
integration-tests/upgrade/ft.go
line 170 at r11 (raw file):
Previously, keyleu (Keyne) wrote…
The error comes from the wasm handler. It throws an ABCI error.
ah I see, because we pass that message to smart contract to be executed from there. Okay.
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @silverspase and @ysv)
This change is