Skip to content

Commit

Permalink
Fix Migrate4to5 for very old contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Oct 17, 2023
1 parent d321206 commit 8a67990
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x/compute/internal/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,13 @@ var ZeroSender = sdk.AccAddress{
}

func (c ContractInfo) InitialHistory(initMsg []byte) ContractCodeHistoryEntry {
if c.Created == nil {
c.Created = &AbsoluteTxPosition{
BlockHeight: 0,
TxIndex: 0,
}
}

return ContractCodeHistoryEntry{
Operation: ContractCodeHistoryOperationTypeInit,
CodeID: c.CodeID,
Expand Down

0 comments on commit 8a67990

Please sign in to comment.