spec/lib/stellar/transaction_spec.rb in stellar-base-0.20.0 vs spec/lib/stellar/transaction_spec.rb in stellar-base-0.21.0

- old
+ new

@@ -13,9 +13,41 @@ ] }) end let(:key_pair){ Stellar::KeyPair.random } + describe ".path_payment_strict_receive" do + it 'works' do + tx = Stellar::Transaction.path_payment_strict_receive({ + account: Stellar::KeyPair.random, + sequence: 1, + fee: 100, + destination: Stellar::KeyPair.random, + with: [:alphanum4, "USD", Stellar::KeyPair.master, 10], + amount: [:alphanum4, "EUR", Stellar::KeyPair.master, 9.2], + }) + + expect(tx.operations.size).to eq(1) + expect(tx.operations.first.body.arm).to eql(:path_payment_strict_receive_op) + end + end + + describe ".path_payment_strict_send" do + it 'works' do + tx = Stellar::Transaction.path_payment_strict_send({ + account: Stellar::KeyPair.random, + sequence: 1, + fee: 100, + destination: Stellar::KeyPair.random, + with: [:alphanum4, "USD", Stellar::KeyPair.master, 10], + amount: [:alphanum4, "EUR", Stellar::KeyPair.master, 9.2], + }) + + expect(tx.operations.size).to eq(1) + expect(tx.operations.first.body.arm).to eql(:path_payment_strict_send_op) + end + end + describe "#sign" do let(:result){ subject.sign(key_pair) } it "returns a signature of SHA256(signature_base of the transaction)" do hash = Digest::SHA256.digest(subject.signature_base)