-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc0d826
commit f78a5a9
Showing
4 changed files
with
42 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package app | ||
|
||
import "github.com/ubclaunchpad/cumulus/blockchain" | ||
|
||
// User holds basic user information. | ||
type User struct { | ||
// Wallet holds the users wallets (currently just support 1). | ||
Wallet blockchain.Wallet | ||
} | ||
|
||
var currentUser *User | ||
|
||
func init() { | ||
// Temporary to create a new user for testing. | ||
currentUser = NewUser() | ||
} | ||
|
||
// NewUser creates a new user | ||
func NewUser() *User { | ||
return &User{ | ||
Wallet: blockchain.NewWallet(), | ||
} | ||
} | ||
|
||
// GetCurrentUser returns the current user. | ||
func GetCurrentUser() *User { | ||
return currentUser | ||
} |
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
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