-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* GSW-1845 refactor: use array if possible rather than avl * GSW-1845 feat: skip minting gns block - if emission is ended * GSW-1845 refactor: if block range for emission includes emission end height, mint until end height * GSW-1845 refactor: assert too many emission amount * GSW-1845 refactor: calculate height for next halving when avg time changes * fix: default interval time to 2 sec --------- Co-authored-by: 0xTopaz <[email protected]>
- Loading branch information
Showing
14 changed files
with
764 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
package gns | ||
|
||
import ( | ||
"std" | ||
"testing" | ||
"time" | ||
|
||
"gno.land/p/demo/grc/grc20" | ||
"gno.land/p/demo/ownable" | ||
|
||
"gno.land/r/gnoswap/v1/consts" | ||
) | ||
|
||
func testResetGnsTokenObject(t *testing.T) { | ||
func resetObject(t *testing.T) { | ||
t.Helper() | ||
|
||
resetGnsTokenObject(t) | ||
resetHalvingRelatedObject(t) | ||
|
||
height := std.GetHeight() | ||
lastMintedHeight = height | ||
startHeight = height | ||
startTimestamp = time.Now().Unix() | ||
} | ||
|
||
func resetGnsTokenObject(t *testing.T) { | ||
t.Helper() | ||
|
||
Token, privateLedger = grc20.NewToken("Gnoswap", "GNS", 6) | ||
UserTeller = Token.CallerTeller() | ||
owner = ownable.NewWithAddress(consts.ADMIN) | ||
|
||
privateLedger.Mint(owner.Owner(), INITIAL_MINT_AMOUNT) | ||
} | ||
|
||
func resetHalvingRelatedObject(t *testing.T) { | ||
t.Helper() | ||
|
||
startHeight = std.GetHeight() | ||
startTimestamp = time.Now().Unix() | ||
|
||
initializeHalvingData() | ||
setEndTimestamp(startTimestamp + consts.TIMESTAMP_YEAR*HALVING_END_YEAR) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.