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
GitLab 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
0f688689
Commit
0f688689
authored
Nov 16, 2021
by
Gomez Goiri, Aitor
Browse files
Options
Downloads
Patches
Plain Diff
Adapting CLI to new statuses validated by chaincode
parent
c9036e0d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/sidenor-cli/index.js
+4
-4
4 additions, 4 deletions
apps/sidenor-cli/index.js
apps/utils/utils.js
+1
-3
1 addition, 3 deletions
apps/utils/utils.js
scripts/create-users.js
+2
-2
2 additions, 2 deletions
scripts/create-users.js
with
7 additions
and
9 deletions
apps/sidenor-cli/index.js
+
4
−
4
View file @
0f688689
...
...
@@ -60,7 +60,7 @@ const sendToCone = async (apiClient, { assetId: paramAssetId }) => {
const
assetToBeSent
=
await
apiClient
.
getAsset
(
assetId
)
const
assetsInCone
=
await
apiClient
.
richQuery
({
fields
:
{
status
:
STATUSES
.
SLAG_
CONE
status
:
STATUSES
.
SLAG_
BATCH
}
})
...
...
@@ -75,7 +75,7 @@ const sendToCone = async (apiClient, { assetId: paramAssetId }) => {
?
assetToBeSent
.
location
:
assetsInCone
[
0
].
location
,
fields
:
{
status
:
STATUSES
.
SLAG_
CONE
status
:
STATUSES
.
SLAG_
BATCH
}
}
)
...
...
@@ -93,13 +93,13 @@ const sendToStock = async (apiClient, { assetId: paramAssetId }) => {
(
await
promptAssetSelection
(
await
apiClient
.
richQuery
({
fields
:
{
status
:
STATUSES
.
SLAG_
CONE
status
:
STATUSES
.
SLAG_
BATCH
}
})
))
const
assetToBeSent
=
await
apiClient
.
getAsset
(
assetId
)
if
(
assetToBeSent
.
fields
.
status
!==
STATUSES
.
SLAG_
CONE
)
{
if
(
assetToBeSent
.
fields
.
status
!==
STATUSES
.
SLAG_
BATCH
)
{
console
.
error
(
"
You can only combine a cone with a stock
"
)
return
}
...
...
This diff is collapsed.
Click to expand it.
apps/utils/utils.js
+
1
−
3
View file @
0f688689
...
...
@@ -45,9 +45,7 @@ const TYPES = {
const
STATUSES
=
{
SLAG
:
"
slag
"
,
// TODO SLAG_CONE y SLAG_BATCH son lo mismo!
// SLAG_CONE: "escoria en cono",
SLAG_BATCH
:
"
batched
"
,
SLAG_BATCH
:
"
batched
"
,
// escoria en cono
STOCK
:
"
stocked
"
,
SOLD
:
"
sold
"
,
DISCARDED
:
"
discarded
"
...
...
This diff is collapsed.
Click to expand it.
scripts/create-users.js
+
2
−
2
View file @
0f688689
...
...
@@ -33,7 +33,7 @@ const modifyUser = async (
return
modUser
}
const
createOrModifyUserIfNeeded
=
async
(
const
createOrModifyUserIfNeeded
=
(
apiClient
,
username
,
password
,
...
...
@@ -42,7 +42,7 @@ const createOrModifyUserIfNeeded = async (
)
=>
{
try
{
// Await is needed here to force the catch clausule if something goes wrong
return
await
apiClient
.
createUser
(
return
apiClient
.
createUser
(
username
,
password
,
organization
,
...
...
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