Change token type from i64 to u64

Fixes #1526
This commit is contained in:
Greg Fitzgerald
2018-11-05 09:36:22 -07:00
parent c4346e6191
commit c9138f964b
31 changed files with 183 additions and 186 deletions

View File

@@ -5,7 +5,7 @@ use pubkey::Pubkey;
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct Account {
/// tokens in the account
pub tokens: i64,
pub tokens: u64,
/// user data
/// A transaction can write to its userdata
pub userdata: Vec<u8>,
@@ -21,7 +21,7 @@ pub struct Account {
impl Account {
// TODO do we want to add executable and leader_program_id even though they should always be false/default?
pub fn new(tokens: i64, space: usize, program_id: Pubkey) -> Account {
pub fn new(tokens: u64, space: usize, program_id: Pubkey) -> Account {
Account {
tokens,
userdata: vec![0u8; space],