Skip to content

Commit

Permalink
Add ERC20-like Token program
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Oct 9, 2018
1 parent e5c0b19 commit f3a779e
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use system_transaction::SystemTransaction;
use tictactoe_dashboard_program::TicTacToeDashboardProgram;
use tictactoe_program::TicTacToeProgram;
use timing::{duration_as_us, timestamp};
use token_program::TokenProgram;
use transaction::Transaction;
use window::WINDOW_SIZE;

Expand Down Expand Up @@ -410,6 +411,10 @@ impl Bank {
if TicTacToeDashboardProgram::process_transaction(&tx, accounts).is_err() {
return Err(BankError::ProgramRuntimeError);
}
} else if TokenProgram::check_id(&tx.program_id) {
if TokenProgram::process_transaction(&tx, accounts).is_err() {
return Err(BankError::ProgramRuntimeError);
}
} else if self.loaded_contract(&tx, accounts) {
} else {
return Err(BankError::UnknownContractId);
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub mod thin_client;
pub mod tictactoe_dashboard_program;
pub mod tictactoe_program;
pub mod timing;
pub mod token_program;
pub mod tpu;
pub mod transaction;
pub mod tvu;
Expand Down
Loading

0 comments on commit f3a779e

Please sign in to comment.