message: starcoin vm to support BlockMetaData and StateSet txn types
diff: @@ -36,6 +36,16 @@ use vm::{
  gas_schedule::{CostTable, GasAlgebra, GasUnits},
  transaction_metadata::TransactionMetadata,
  };
  +use once_cell::sync::Lazy;
  +
  +
  +pub static KEEP_STATUS: Lazy<TransactionStatus> =
  + Lazy::new(|| TransactionStatus::Keep(VMStatus::new(StatusCode::EXECUTED)));
  +
  +// We use 10 as the assertion error code for insufficient balance within the Libra coin contract.
  +pub static DISCARD_STATUS: Lazy<TransactionStatus> = Lazy::new(|| {
  + TransactionStatus::Discard(VMStatus::new(StatusCode::ABORTED).with_sub_status(10))
  +});
  #[derive(Clone)]
  /// Wrapper of MoveVM
  @@ -195,7 +205,37 @@ impl StarcoinVM {
  };
  output
  }
  - _ => TransactionHelper::fake_starcoin_transaction_output(),
  + Transaction::BlockMetadata(block_metadata) => {
  +// let (_id, _timestamp, author) = block_metadata.into_inner().unwrap();
  +// let access_path = AccessPath::new_for_account(author);
  +// let account_resource: AccountResource = state_store
  +// .get_from_statedb(&access_path)
  +// .and_then(|blob| match blob {
  +// Some(blob) => Ok(blob),
  +// None => {
  +// state_store.create_account(author)?;
  +// Ok(state_store
  +// .get_from_statedb(&access_path)?
  +// .expect("account resource must exist."))
  +// }
  +// })
  +// .and_then(|blob| blob.try_into())?;
  +//
  +// let new_account_resource = AccountResource::new(
  +// account_resource.balance() + 50_00000000,
  +// account_resource.sequence_number(),
  +// account_resource.authentication_key().clone(),
  +// );
  +// state_store.set(access_path, new_account_resource.try_into()?)?;
  + TransactionOutput::new(vec![], 0, KEEP_STATUS.clone())
  + }
  + Transaction::StateSet(state_set) => {
  + let result_status = match chain_state.apply(state_set) {
  + Ok(_) => KEEP_STATUS.clone(),
  + Err(_) => DISCARD_STATUS.clone(),
  + };
  + TransactionOutput::new(vec![], 0, result_status)
  + }
  }
  }
  }
  