Exemplo n.º 1
0
Arquivo: St.cs Projeto: Ibasa/Ripple
        public void WriteAmount(StAmountFieldCode fieldCode, IssuedAmount value)
        {
            WriteFieldId(StTypeCode.Amount, (uint)fieldCode);
            var span = bufferWriter.GetSpan(48);

            System.Buffers.Binary.BinaryPrimitives.WriteUInt64BigEndian(bufferWriter.GetSpan(8), Currency.ToUInt64Bits(value.Value));
            value.CurrencyCode.CopyTo(span.Slice(8));
            value.Issuer.CopyTo(span.Slice(28));
            bufferWriter.Advance(48);
        }
Exemplo n.º 2
0
        public void TestToString(string issuer, string currencyCode, string value, string expected)
        {
            var amount = new IssuedAmount(new AccountId(issuer), new CurrencyCode(currencyCode), Currency.Parse(value));

            Assert.Equal(expected, amount.ToString());
        }