Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Leveraging blockchain usage to enhance slag exchange
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HyperCOG public
Leveraging blockchain usage to enhance slag exchange
Commits
58fea059
Commit
58fea059
authored
3 years ago
by
Gomez Goiri, Aitor
Browse files
Options
Downloads
Patches
Plain Diff
Accepting user input to specify first bid amount
parent
3034968f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/batch-sim/index.js
+11
-4
11 additions, 4 deletions
apps/batch-sim/index.js
apps/cement-cli/lib.js
+4
-3
4 additions, 3 deletions
apps/cement-cli/lib.js
apps/sidenor-cli/lib.js
+1
-1
1 addition, 1 deletion
apps/sidenor-cli/lib.js
with
16 additions
and
8 deletions
apps/batch-sim/index.js
+
11
−
4
View file @
58fea059
...
...
@@ -41,16 +41,23 @@ const simulateCycle = async (arg1, cmd) => {
batchId
=
await
createAssetAndSendToCone
(
apiClient
,
"
simulated asset 2
"
)
batchId
=
await
createAssetAndSendToCone
(
apiClient
,
"
simulated asset 3
"
)
const
stock
Id
=
await
sendToStock
(
apiClient
,
{
assetId
:
batchId
})
const
s
electedS
tock
=
await
sendToStock
(
apiClient
,
{
assetId
:
batchId
})
await
signInAs
(
apiClient
,
otherArgs
.
cement1User
,
password
)
await
bidAsset
(
apiClient
,
{
assetId
:
stockId
,
quantity
:
1000
,
price
:
2
})
await
bidAsset
(
apiClient
,
{
assetId
:
selectedStock
.
id
,
price
:
2
})
await
signInAs
(
apiClient
,
otherArgs
.
cement2User
,
password
)
await
bidAsset
(
apiClient
,
{
assetId
:
stockId
,
quantity
:
500
,
price
:
3
})
await
bidAsset
(
apiClient
,
{
assetId
:
selectedStock
.
id
,
quantity
:
selectedStock
.
quantity
-
500
,
price
:
3
})
await
signInAs
(
apiClient
,
otherArgs
.
sidenorUser
,
password
)
await
acceptBid
(
apiClient
,
{
assetId
:
stock
I
d
})
await
acceptBid
(
apiClient
,
{
assetId
:
s
electedS
tock
.
i
d
})
}
const
program
=
createCLIApp
()
...
...
This diff is collapsed.
Click to expand it.
apps/cement-cli/lib.js
+
4
−
3
View file @
58fea059
...
...
@@ -11,6 +11,7 @@ const bidAsset = async (
const
biddableAssets
=
await
apiClient
.
getBiddableAssets
()
const
assetId
=
paramAssetId
||
(
await
promptAssetSelection
(
biddableAssets
))
const
assetToBid
=
biddableAssets
.
find
(({
id
})
=>
id
===
assetId
)
let
chosenQuantity
=
quantity
if
(
!
quantity
)
{
...
...
@@ -18,19 +19,19 @@ const bidAsset = async (
{
type
:
"
number
"
,
name
:
"
inputQuantity
"
,
message
:
"
Choose an ammount of slag
"
message
:
`
Choose an ammount of slag
(in
${
assetToBid
.
units
}
, max
${
assetToBid
.
quantity
}
):`
}
])
chosenQuantity
=
inputQuantity
}
let
chosenPrice
=
price
if
(
!
quantity
)
{
if
(
!
price
)
{
const
{
inputPrice
}
=
await
inquirer
.
prompt
([
{
type
:
"
number
"
,
name
:
"
inputPrice
"
,
message
:
"
Provide the offered price
"
message
:
"
Provide the offered price
(in €):
"
}
])
chosenPrice
=
inputPrice
...
...
This diff is collapsed.
Click to expand it.
apps/sidenor-cli/lib.js
+
1
−
1
View file @
58fea059
...
...
@@ -169,7 +169,7 @@ const sendToStock = async (apiClient, { assetId: paramAssetId }) => {
console
.
log
(
"
Moved to stock
"
,
newStockAsset
.
id
)
return
newStockAsset
.
id
return
newStockAsset
}
const
bidResponse
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment