Skip to content

Commit

Permalink
fix: invalid benchmark scripts (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored Dec 19, 2024
1 parent ea3c6b9 commit 1560f54
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 52 deletions.
34 changes: 19 additions & 15 deletions test/performance/scripts/any_bounded_to_any.js
Original file line number Diff line number Diff line change
@@ -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()
}
}
}
}
}
]
}
34 changes: 19 additions & 15 deletions test/performance/scripts/any_unbounded_to_any.js
Original file line number Diff line number Diff line change
@@ -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()
}
}
}
}
}
]
}
30 changes: 17 additions & 13 deletions test/performance/scripts/world_to_any.js
Original file line number Diff line number Diff line change
@@ -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()
}
}
}
}
}
]
}


Expand Down
22 changes: 13 additions & 9 deletions test/performance/scripts/world_to_bank.js
Original file line number Diff line number Diff line change
@@ -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: {}
}
}
}
}
]
}

0 comments on commit 1560f54

Please sign in to comment.