makeDeployCodeTx method

Future<Transaction> makeDeployCodeTx (Uint8List code, String name, String version, String author, String email, String desc, bool needStoreage, int gasPrice, int gasLimit, Address payer)

Implementation

Future<Transaction> makeDeployCodeTx(
    Uint8List code,
    String name,
    String version,
    String author,
    String email,
    String desc,
    bool needStoreage,
    int gasPrice,
    int gasLimit,
    Address payer) async {
  var dc = DeployCode();
  dc.author = author;
  dc.code = code;
  dc.name = name;
  dc.version = version;
  dc.email = email;
  dc.needStorage = needStoreage;
  dc.desc = desc;

  var tx = await Transaction.create();
  tx.version = 0x00;
  tx.payload = dc;
  tx.type = TxType.deploy;
  tx.gasPrice = gasPrice;
  tx.gasLimit = gasLimit;
  tx.payer = payer;
  return tx;
}