Exemplo n.º 1
0
        /// <inheritdoc />
        public SmartContractReceipt GetReceipt(uint256 txHash)
        {
            using (DBreeze.Transactions.Transaction t = this.engine.GetTransaction())
            {
                byte[] result = t.Select <byte[], byte[]>(TableName, txHash.ToBytes()).Value;

                if (result == null)
                {
                    return(null);
                }

                return(SmartContractReceipt.FromBytes(result));
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        public void SaveReceipt(
            uint256 txHash,
            ulong blockHeight,
            uint160 newContractAddress,
            ulong gasConsumed,
            bool successful,
            Exception exception,
            object returned)
        {
            Guard.NotNull(txHash, nameof(txHash));

            var receipt = new SmartContractReceipt(txHash, blockHeight, newContractAddress, gasConsumed, successful, exception, returned);

            using (DBreeze.Transactions.Transaction t = this.engine.GetTransaction())
            {
                t.Insert <byte[], byte[]>(TableName, txHash.ToBytes(), receipt.ToBytes());
                t.Commit();
            }
        }