-
Notifications
You must be signed in to change notification settings - Fork 410
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
Start Pin/Unpin contract #436
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.
Nice start, a few comments
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.
Nice stuff.
Still missing the pieces you noted above, but only a few stylistic nits in the code.
93a20e7
to
6c3c197
Compare
Codecov Report
@@ Coverage Diff @@
## master #436 +/- ##
==========================================
+ Coverage 55.44% 55.69% +0.25%
==========================================
Files 39 39
Lines 4080 4189 +109
==========================================
+ Hits 2262 2333 +71
- Misses 1627 1663 +36
- Partials 191 193 +2
|
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.
Great work.
I added one minor comment you may want to integrate later (testing.TB), but this looks great. I'm going to merge it in and start rebasing other PRs on top.
"testing" | ||
) | ||
|
||
func BenchmarkExecution(b *testing.B) { |
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'd love to see the numbers from this on, say, wasmd 0.12 (which had the old wasmer engine), so we can compare the speedup for uncached over the last 3-4 months, plus the huge speedup for pinned contracts
if err := p.ValidateBasic(); err != nil { | ||
return err | ||
} | ||
for _, v := range p.CodeIDs { |
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.
nice, i like the list of code ids
} | ||
require.NoError(t, gotErr) | ||
|
||
// and proposal execute |
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.
nice shortcut to mock out the whole voting process
@@ -388,12 +405,12 @@ func handleExecute(ctx sdk.Context, k *Keeper, msg *types.MsgExecuteContract) (* | |||
return res, nil | |||
} | |||
|
|||
func RandomAccountAddress(_ *testing.T) sdk.AccAddress { | |||
func RandomAccountAddress(_ TestingT) sdk.AccAddress { |
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.
There is a testing.TB
interface I have seen before that probably is what you want here - one interface that lets you use the code both in unit tests as well as benchmarks.
Resolves #401