Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC20-like Token program (v0.9) #1451

Merged
merged 3 commits into from
Oct 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 1 addition & 2 deletions src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use bank::Bank;
use bincode::deserialize;
use budget_transaction::BudgetTransaction;
use counter::Counter;
use entry::Entry;
use log::Level;
Expand Down Expand Up @@ -224,7 +223,7 @@ impl BankingStage {
.zip(vers)
.filter_map(|(tx, ver)| match tx {
None => None,
Some((tx, _addr)) => if tx.verify_plan() && ver != 0 {
Some((tx, _addr)) => if ver != 0 {
Some(tx)
} else {
None
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