Created
July 9, 2020 10:27
-
-
Save MariusVanDerWijden/e36f493b23f1a72d2e7223fea7ee0485 to your computer and use it in GitHub Desktop.
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
tx, tx2, tx3 := new(types.Transaction), new(types.Transaction), new(types.Transaction) | |
// Send and abort both transactions | |
backend.SendTransaction(ctx, tx) | |
backend.SendTransaction(ctx, tx2) | |
backend.Rollback() | |
// Commits transaction to the chain | |
backend.SendTransaction(ctx, tx3) | |
backend.Commit() | |
// Use adjust time to test time-dependent functions | |
backend.AdjustTime(24 * time.Hour) | |
// Adjust time can only be called on an empty block and you need to call commit afterwards | |
backend.Commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment