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

Conditional migrate calling #1966

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

kulikthebird
Copy link
Contributor

No description provided.

@kulikthebird kulikthebird self-assigned this Aug 21, 2024
@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 7 times, most recently from 5aa7844 to f3dc1ac Compare August 26, 2024 15:02
@kulikthebird kulikthebird marked this pull request as ready for review August 26, 2024 22:08
x/wasm/keeper/keeper.go Outdated Show resolved Hide resolved
x/wasm/keeper/keeper.go Outdated Show resolved Hide resolved
x/wasm/keeper/keeper.go Outdated Show resolved Hide resolved
x/wasm/keeper/keeper.go Outdated Show resolved Hide resolved
@kulikthebird kulikthebird force-pushed the tkulik/conditional_migrate branch 3 times, most recently from ee10140 to 797cfa0 Compare August 27, 2024 14:48
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.80%. Comparing base (4ca5cea) to head (93289c1).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
x/wasm/keeper/keeper.go 77.56% <100.00%> (+0.08%) ⬆️
x/wasm/types/wasmer_engine.go 0.00% <ø> (ø)

@kulikthebird
Copy link
Contributor Author

I need to recompile the hackatom binaries to reduce the size

@chipshort
Copy link
Collaborator

Did you use the optimizer?

@kulikthebird
Copy link
Contributor Author

Did you use the optimizer?

I updated the binaries and used the optimizer, thanks!

Copy link
Contributor

@pinosu pinosu left a comment

Choose a reason for hiding this comment

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

Nice work! LGTM 👍

@kulikthebird kulikthebird merged commit 60ed81c into main Nov 4, 2024
17 checks passed
@kulikthebird kulikthebird deleted the tkulik/conditional_migrate branch November 4, 2024 09:00
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +656 to +676
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
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Conditional migrate call with extra MigrateInfo argument after contract update
4 participants