public void Execute(int transactionId) { var bonded = new TableName { MethodName = "bonded", ModuleName = "Staking" }; var payee1 = new TableName { MethodName = "payee", ModuleName = "Staking" }; var intAmount = BigInteger.Parse(amount); var tid = new TableRow { RowIndex = 1, RowName = "transactionindex", Value = new List <string> { transactionId.ToString() } }; var part1 = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber, Value = new List <string> { (intAmount).ToString() } }; var part2 = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber, Value = new List <string> { (intAmount).ToString() } }; _dbAdapter.InsertIntoStorage(bonded, part1); _dbAdapter.InsertIntoStorage(payee1, part2); var transactionSenderKey = new TableRow { RowIndex = 0, RowName = "Sender", Value = new List <string> { sk } }; var transfer = new TableName { MethodName = "bond", ModuleName = "Staking" }; var controller = new TableRow { RowIndex = 0, RowName = "controller", Value = new List <string> { rk } }; var payeeDest = new TableRow { RowIndex = 0, RowName = "payee", Value = new List <string> { payee } }; var transactionValue = new TableRow { RowIndex = 1, RowName = "value", Value = new List <string> { amount } }; var blocknumber = new TableRow { RowIndex = 1, RowName = "blocknumber", Value = new List <string> { _pex.BlockNumber.ToString() } }; var nonce = new TableRow { RowIndex = 0, RowName = "Nonce", Value = new List <string> { _pex.Nonce.ToString() } }; var signatureKey = new TableRow { RowIndex = 0, RowName = "Signature", Value = new List <string> { signature } }; var status = new TableRow { RowIndex = 0, RowName = "Status", Value = new List <string> { _pex.Status.ToString() } }; var blockHash = new TableRow { RowIndex = 0, RowName = "Block", Value = new List <string> { _pex.BlockHash.ToString() } }; _dbAdapter.InsertIntoCall(transfer, new List <TableRow> { blockHash, tid, status, blocknumber, nonce, signatureKey, transactionSenderKey, controller, payeeDest, transactionValue }); }
public void Execute(int transactionId) { var freebal = new TableName { MethodName = "FreeBalance", ModuleName = "Balances" }; var curValueRow = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber }; BigInteger curValue = 0; var sval = _dbAdapter.GetLastStorageValue(freebal, curValueRow); if (!sval.Equals("")) { curValue = BigInteger.Parse(sval); } var part1 = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber, Value = new List <string> { (amount + curValue).ToString() } }; _dbAdapter.InsertIntoStorage(freebal, part1); var transactionSenderKey = new TableRow { RowIndex = 0, RowName = "Sender", Value = new List <string> { sk } }; var transfer = new TableName { MethodName = "bond_extra", ModuleName = "Staking" }; var tid = new TableRow { RowIndex = 1, RowName = "transactionindex", Value = new List <string> { transactionId.ToString() } }; var maxAdditional = new TableRow { RowIndex = 1, RowName = "max_additional", Value = new List <string> { amount.ToString() } }; var blocknumber = new TableRow { RowIndex = 1, RowName = "blocknumber", Value = new List <string> { _pex.BlockNumber.ToString() } }; var nonce = new TableRow { RowIndex = 0, RowName = "Nonce", Value = new List <string> { _pex.Nonce.ToString() } }; var signatureKey = new TableRow { RowIndex = 0, RowName = "Signature", Value = new List <string> { _pex.Signature } }; var status = new TableRow { RowIndex = 0, RowName = "Status", Value = new List <string> { _pex.Status.ToString() } }; var blockHash = new TableRow { RowIndex = 0, RowName = "Block", Value = new List <string> { _pex.BlockHash.ToString() } }; _dbAdapter.InsertIntoCall(transfer, new List <TableRow> { blockHash, tid, signatureKey, status, nonce, transactionSenderKey, maxAdditional, blocknumber }); }
public void Execute(int transactionId) { var fb = new TableName { ModuleName = "Balances", MethodName = "FreeBalance" }; var rb = new TableName { ModuleName = "Balances", MethodName = "ReservedBalance" }; var ti = new TableName { ModuleName = "Balances", MethodName = "TotalIssuance" }; _dbAdapter.InsertIntoStorage(fb, new TableRow { BlockNumber = pex.BlockNumber, RowName = "value", Value = new List <string> { newFree } }); _dbAdapter.InsertIntoStorage(rb, new TableRow { BlockNumber = pex.BlockNumber, RowName = "value", Value = new List <string> { newReserved } }); var bsb = new TableName { ModuleName = "Balances", MethodName = "set_balance" }; var who = new TableRow { RowIndex = 0, RowName = "who", Value = new List <string> { rk } }; var nFree = new TableRow { RowIndex = 0, RowName = "new_free", Value = new List <string> { newFree } }; var nReserved = new TableRow { RowIndex = 0, RowName = "new_reserved", Value = new List <string> { newReserved } }; var tid = new TableRow { RowIndex = 1, RowName = "transactionindex", Value = new List <string> { transactionId.ToString() } }; var transactionSenderKey = new TableRow { RowIndex = 0, RowName = "Sender", Value = new List <string> { sk } }; var blocknumber = new TableRow { RowIndex = 0, RowName = "blocknumber", Value = new List <string> { pex.BlockNumber.ToString() } }; var nonce = new TableRow { RowIndex = 0, RowName = "Nonce", Value = new List <string> { pex.Nonce.ToString() } }; var signatureKey = new TableRow { RowIndex = 0, RowName = "Signature", Value = new List <string> { pex.Signature } }; var status = new TableRow { RowIndex = 0, RowName = "Status", Value = new List <string> { pex.Status.ToString() } }; var blockHash = new TableRow { RowIndex = 0, RowName = "Block", Value = new List <string> { pex.BlockHash.ToString() } }; _dbAdapter.InsertIntoCall(bsb, new List <TableRow> { blockHash, tid, status, nonce, signatureKey, who, nFree, nReserved, blocknumber, transactionSenderKey }); }
public void Execute(int transactionId) { // Set FREEBALANCE for participants // Add transfer value var freebal = new TableName { MethodName = "FreeBalance", ModuleName = "Balances" }; var curValueRow = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber }; BigInteger curValue = 0; var sval = _dbAdapter.GetLastStorageValue(freebal, curValueRow); if (!sval.Equals("")) { curValue = BigInteger.Parse(sval); } var intAmount = BigInteger.Parse(amount); var part1 = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber, Value = new List <string> { (curValue - intAmount).ToString() } }; var part2 = new TableRow { RowName = "value", BlockNumber = _pex.BlockNumber, Value = new List <string> { (curValue + intAmount).ToString() } }; _dbAdapter.InsertIntoStorage(freebal, part1); _dbAdapter.InsertIntoStorage(freebal, part2); var transfer = new TableName { MethodName = "transfer", ModuleName = "Balances" }; var nonce = new TableRow { RowIndex = 0, RowName = "Nonce", Value = new List <string> { _pex.Nonce.ToString() } }; var blockHash = new TableRow { RowIndex = 0, RowName = "Block", Value = new List <string> { _pex.BlockHash.ToString() } }; var signatureKey = new TableRow { RowIndex = 0, RowName = "Signature", Value = new List <string> { _pex.Signature } }; var status = new TableRow { RowIndex = 0, RowName = "Status", Value = new List <string> { _pex.Status.ToString() } }; var transactionSenderKey = new TableRow { RowIndex = 0, RowName = "Sender", Value = new List <string> { sk } }; var transactionDest = new TableRow { RowIndex = 0, RowName = "dest", Value = new List <string> { rk } }; var transactionValue = new TableRow { RowIndex = 1, RowName = "value", Value = new List <string> { amount } }; var blocknumber = new TableRow { RowIndex = 0, RowName = "blocknumber", Value = new List <string> { _pex.BlockNumber.ToString() } }; var tid = new TableRow { RowIndex = 1, RowName = "transactionindex", Value = new List <string> { transactionId.ToString() } }; _dbAdapter.InsertIntoCall(transfer, new List <TableRow> { blockHash, tid, status, blocknumber, nonce, signatureKey, transactionDest, transactionValue, transactionSenderKey }); }