(source, destination)
| 220 | } |
| 221 | |
| 222 | function postTxn(source, destination) { |
| 223 | var amount = Math.floor(Math.random() * (1000 - 100 + 1)) + 100; // 100..1000 |
| 224 | var payload = JSON.stringify({ |
| 225 | amount: 100, |
| 226 | description: "load test", |
| 227 | precision: 100, |
| 228 | allow_overdraft: true, |
| 229 | inflight: true, |
| 230 | reference: uuidv4(), |
| 231 | currency: "USD", |
| 232 | source: source, |
| 233 | destination: destination, |
| 234 | }); |
| 235 | |
| 236 | var headers = { "Content-Type": "application/json" }; |
| 237 | if (API_KEY) { |
| 238 | headers["X-LedgerForge-Key"] = API_KEY; |
| 239 | } |
| 240 | var res = http.post(URL, payload, { |
| 241 | headers: headers, |
| 242 | timeout: "30s", |
| 243 | tags: { endpoint: "transactions" }, |
| 244 | }); |
| 245 | |
| 246 | check(res, { |
| 247 | "is status 201": function (r) { |
| 248 | return r.status === 201; |
| 249 | }, |
| 250 | }); |
| 251 | } |
| 252 | |
| 253 | export default function () { |
| 254 | // baseline, ramp, soak, spike use this |
no outgoing calls
no test coverage detected