-
Notifications
You must be signed in to change notification settings - Fork 404
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
Conditional migrate calling #1966
Conversation
5aa7844
to
f3dc1ac
Compare
ee10140
to
797cfa0
Compare
adda66f
to
b8ebd23
Compare
017b75b
to
7ad3f2e
Compare
7ad3f2e
to
ad6dc5b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1966 +/- ##
==========================================
+ Coverage 48.79% 48.80% +0.01%
==========================================
Files 65 65
Lines 10079 10082 +3
==========================================
+ Hits 4918 4921 +3
Misses 4726 4726
Partials 435 435
|
I need to recompile the hackatom binaries to reduce the size |
Did you use the optimizer? |
ad6dc5b
to
93289c1
Compare
I updated the binaries and used the optimizer, thanks! |
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 work! LGTM 👍
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
if instanceLevel == 1 { | ||
return &wasmvmtypes.ContractResult{Ok: &wasmvmtypes.Response{}}, 0, nil | ||
} | ||
instanceLevel++ | ||
submsgPayload := fmt.Sprintf(`{"sub":%d}`, instanceLevel) | ||
return &wasmvmtypes.ContractResult{ | ||
Ok: &wasmvmtypes.Response{ | ||
Messages: []wasmvmtypes.SubMsg{ | ||
{ | ||
ReplyOn: wasmvmtypes.ReplyNever, | ||
Msg: wasmvmtypes.CosmosMsg{ | ||
Wasm: &wasmvmtypes.WasmMsg{Migrate: &wasmvmtypes.MigrateMsg{ | ||
ContractAddr: example1.Contract.String(), | ||
NewCodeID: example2.CodeID, | ||
Msg: []byte(submsgPayload), | ||
}}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, 0, nil |
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.
nit: Could you deduplicate this? This code and the one for MigrateFn are identical.
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.
No description provided.