Skip to content

Commit

Permalink
Merge pull request #137 from loomnetwork/update-init
Browse files Browse the repository at this point in the history
[WIP] Add transaction to update init JSON
  • Loading branch information
mattkanwisher authored Sep 25, 2018
2 parents e15e331 + 14eb7a5 commit 61eb942
Show file tree
Hide file tree
Showing 12 changed files with 4,247 additions and 30 deletions.
8 changes: 6 additions & 2 deletions battleground/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func UserMatchKey(userID string) []byte {
return []byte("user:" + userID + ":match")
}

func MakeVersionedKey(version string, key []byte) []byte {
return util.PrefixKey([]byte(version), key)
}

// func userAccountKey(id string) []byte {
// return util.PrefixKey(userPreifx, []byte(id))
// }
Expand Down Expand Up @@ -98,9 +102,9 @@ func saveCardList(ctx contract.Context, cardList *zb.CardList) error {
return nil
}

func loadCardList(ctx contract.StaticContext) (*zb.CardList, error) {
func loadCardList(ctx contract.StaticContext, version string) (*zb.CardList, error) {
var cl zb.CardList
err := ctx.Get(cardListKey, &cl)
err := ctx.Get(MakeVersionedKey(version, cardListKey), &cl)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 61eb942

Please sign in to comment.