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

Update cionswap LPT denom #217

Closed
wants to merge 3 commits into from
Closed

Update cionswap LPT denom #217

wants to merge 3 commits into from

Conversation

Nicke-lucky
Copy link

Update cionswap LPT denom

@Nicke-lucky Nicke-lucky added the enhancement New feature or request label Aug 6, 2021
@Nicke-lucky Nicke-lucky self-assigned this Aug 6, 2021
}

// SetAutoIncrementId sets Lpt AutoIncrementId for the coinswap module.
func (k Keeper) SetAutoIncrementId(ctx sdk.Context, AutoIncrementId string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • rename AutoIncrementId to lptID
  • define lptID as uint64, serialize as follows
    lptIDBz = make([]byte, 8)
    binary.BigEndian.PutUint64(lptIDBz, lptID)

@@ -0,0 +1,9 @@
#Coinswap LP Denom 优化需求
Copy link
Contributor

Choose a reason for hiding this comment

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

delete this file

Comment on lines 352 to 366
func (k Keeper) SetTibcAutoIncrementId(ctx sdk.Context, AutoIncrementId string) {
store := ctx.KVStore(k.storeKey)
IdWrap := gogotypes.StringValue{Value: AutoIncrementId}
bz := k.cdc.MustMarshalBinaryBare(&IdWrap)
store.Set(types.KeyTibcId, bz)
}

// GetAutoIncrementId returns Tibcid AutoIncrementId of the coinswap module.
func (k Keeper) GetTibcAutoIncrementId(ctx sdk.Context) string {
store := ctx.KVStore(k.storeKey)
bz := store.Get(types.KeyTibcId)

var tibcid = gogotypes.StringValue{}
k.cdc.MustUnmarshalBinaryBare(bz, &tibcid)
return tibcid.Value
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the usage of these two methods?

@chengwenxi
Copy link
Contributor

Replaced by #219

@chengwenxi chengwenxi closed this Aug 10, 2021
@chengwenxi chengwenxi deleted the fix-cionswap branch August 10, 2021 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants