From 1560f5473bebb8757358f667be31791707331b9a Mon Sep 17 00:00:00 2001 From: Ragot Geoffrey Date: Thu, 19 Dec 2024 19:46:50 +0100 Subject: [PATCH] fix: invalid benchmark scripts (#622) --- .../performance/scripts/any_bounded_to_any.js | 34 +++++++++++-------- .../scripts/any_unbounded_to_any.js | 34 +++++++++++-------- test/performance/scripts/world_to_any.js | 30 +++++++++------- test/performance/scripts/world_to_bank.js | 22 +++++++----- 4 files changed, 68 insertions(+), 52 deletions(-) diff --git a/test/performance/scripts/any_bounded_to_any.js b/test/performance/scripts/any_bounded_to_any.js index b96b24b9e..6d12de459 100644 --- a/test/performance/scripts/any_bounded_to_any.js +++ b/test/performance/scripts/any_bounded_to_any.js @@ -1,19 +1,23 @@ function next() { - return { - action: 'CREATE_TRANSACTION', - data: { - plain: `vars { - account $source - account $destination - } - send [USD/2 100] ( - source = $source allowing overdraft up to [USD/2 100] - destination = $destination - )`, - vars: { - destination: "dst:" + uuid(), - source: "src:" + uuid() + return [ + { + action: 'CREATE_TRANSACTION', + data: { + script: { + plain: `vars { + account $source + account $destination + } + send [USD/2 100] ( + source = $source allowing overdraft up to [USD/2 100] + destination = $destination + )`, + vars: { + destination: "dst:" + uuid(), + source: "src:" + uuid() + } + } } } - } + ] } \ No newline at end of file diff --git a/test/performance/scripts/any_unbounded_to_any.js b/test/performance/scripts/any_unbounded_to_any.js index ffbc02224..428d78505 100644 --- a/test/performance/scripts/any_unbounded_to_any.js +++ b/test/performance/scripts/any_unbounded_to_any.js @@ -1,19 +1,23 @@ function next() { - return { - action: 'CREATE_TRANSACTION', - data: { - plain: `vars { - account $source - account $destination - } - send [USD/2 100] ( - source = $source allowing unbounded overdraft - destination = $destination - )`, - vars: { - destination: "dst:" + uuid(), - source: "src:" + uuid() + return [ + { + action: 'CREATE_TRANSACTION', + data: { + script: { + plain: `vars { + account $source + account $destination + } + send [USD/2 100] ( + source = $source allowing unbounded overdraft + destination = $destination + )`, + vars: { + destination: "dst:" + uuid(), + source: "src:" + uuid() + } + } } } - } + ] } \ No newline at end of file diff --git a/test/performance/scripts/world_to_any.js b/test/performance/scripts/world_to_any.js index cf61ae531..504da2583 100644 --- a/test/performance/scripts/world_to_any.js +++ b/test/performance/scripts/world_to_any.js @@ -1,19 +1,23 @@ function next() { - return { - action: 'CREATE_TRANSACTION', - data: { - plain: `vars { - account $destination - } - send [USD/2 100] ( - source = @world - destination = $destination - )`, - vars: { - destination: "dst:" + uuid() + return [ + { + action: 'CREATE_TRANSACTION', + data: { + script: { + plain: `vars { + account $destination + } + send [USD/2 100] ( + source = @world + destination = $destination + )`, + vars: { + destination: "dst:" + uuid() + } + } } } - } + ] } diff --git a/test/performance/scripts/world_to_bank.js b/test/performance/scripts/world_to_bank.js index 66338267d..411439dd2 100644 --- a/test/performance/scripts/world_to_bank.js +++ b/test/performance/scripts/world_to_bank.js @@ -1,12 +1,16 @@ function next() { - return { - action: 'CREATE_TRANSACTION', - data: { - plain: `send [USD/2 100] ( - source = @world - destination = @bank - )`, - vars: {} + return [ + { + action: 'CREATE_TRANSACTION', + data: { + script: { + plain: `send [USD/2 100] ( + source = @world + destination = @bank + )`, + vars: {} + } + } } - } + ] } \ No newline at end of file