/// <summary> /// Initializes a new instance of the <see cref="Transaction"/> class. /// </summary> /// /// <param name="session">The parent session that represents the communication channel to QLDB.</param> /// <param name="txnId">Transaction identifier.</param> /// <param name="logger">Logger to be used by this.</param> internal Transaction(Session session, string txnId, ILogger logger) { this.session = session; this.txnId = txnId; this.logger = logger; this.qldbHash = QldbHash.ToQldbHash(txnId); }
/// <summary> /// Calculate the QLDB hash from statement and parameters. /// </summary> /// /// <param name="seed">QLDB Hash.</param> /// <param name="statement">PartiQL statement.</param> /// <param name="parameters">Parameters to execute.</param> /// /// <returns>QLDB hash.</returns> internal static QldbHash Dot(QldbHash seed, string statement, List <IIonValue> parameters) { QldbHash statementHash = QldbHash.ToQldbHash(statement); foreach (var ionValue in parameters) { statementHash = statementHash.Dot(QldbHash.ToQldbHash(ionValue)); } return(seed.Dot(statementHash)); }