Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2168ab
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Mar 29, 2021
1067a2e
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Mar 29, 2021
f617690
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Mar 30, 2021
3076d4d
remove wrong lines
dadiorchen Mar 30, 2021
eb8adc1
chore: remove wrong lines.
dadiorchen Mar 30, 2021
8512be6
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Mar 30, 2021
5fc0c4f
Merge branch 'eb8adc16c69f20732881fed60301036256ace689' into impact-v…
dadiorchen Mar 30, 2021
e4ba7b1
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Mar 30, 2021
7b55d2d
Merge remote-tracking branch 'greenstand/master' into impact-value
dadiorchen Apr 24, 2021
b0565db
chore: define test for impact value
dadiorchen Apr 24, 2021
fdfc7d3
chore: merge from master
dadiorchen Jun 2, 2021
fda5aa2
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Jun 2, 2021
675f134
Modified docs/api/spec/treetracker-token-api.yaml
dadiorchen Jun 2, 2021
467df14
chore: coding
dadiorchen Jun 2, 2021
c227654
chore: impact value request
dadiorchen Jun 3, 2021
649a073
chore: impact value
dadiorchen Jun 3, 2021
874e34b
Merge branch 'impact-value' of github.com:dadiorchen/treetracker-toke…
dadiorchen Jun 3, 2021
2feba88
chore: can transfer impact value having trust
dadiorchen Jun 3, 2021
57f4a7d
chore: can response with impact value
dadiorchen Jun 4, 2021
3ab886c
chore: accept can response with impact value
dadiorchen Jun 4, 2021
5837b4b
chore: unit test on money change problem
dadiorchen Jun 4, 2021
3ac6580
chore: remove only test
dadiorchen Jun 4, 2021
8c41458
chore: claim is correct
dadiorchen Jun 12, 2021
81bb2e0
feat: can fulfill impact transfer
dadiorchen Jun 12, 2021
94cad7b
chore: pass all tests
dadiorchen Jun 13, 2021
1b00682
docs: fulfill rule for impact value
dadiorchen Jun 13, 2021
b758ccc
fix: got stale data
dadiorchen Jun 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions __tests__/integration/impact-value-transfer.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

describe('Zaven request to send 4 impact value to Meisze', () => {

beforeEach(async () => {
})

it("Meisze accept the request, then token worth 4 impact should belong to Meisze", () => {
});

});
121 changes: 98 additions & 23 deletions docs/api/spec/treetracker-token-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ paths:
- pine
- Tanzania
claim: false
ImpactValue:
value:
impact:
value: 100
accept_deviation: true
sender_wallet: zaven4
receiver_wallet: zaven
required: true
responses:
'201':
Expand All @@ -216,6 +223,22 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/sendRequestProcessedResponse'
examples:
example-1:
value:
originating_wallet: johnwallet1
source_wallet: planeter
destination_wallet: just.a.guy
type: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state: completed
created_at: '2020-07-09T00:41:49+00:00'
closed_at: '2020-07-09T00:41:49+00:00'
application/xml:
schema:
type: object
properties: {}
'202':
description: 'The transfer could not be completely processed because a trust relationship does not exist allowing for automated processing. If a the source wallet is controlled by the authenitcated user, a transfer in the pending state has been created. If the source wallet is not controlled but the authenticated user, but the destination wallet is, then a transfer in the requested state has been created'
content:
Expand Down Expand Up @@ -379,6 +402,16 @@ paths:
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
impace_value_transfered:
type: integer
description: 'The number of impact valued that has been actually transfered, this field is just valid when the transfer request type is setting impact value as the parameter'
'':
type: string
'401':
$ref: '#/components/responses/UnauthorizedError'
'/transfers/{transfer_id}/decline':
Expand Down Expand Up @@ -426,6 +459,14 @@ paths:
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
impact_value_transfered:
type: integer
description: 'The number of impact valued that has been actually transfered, this field is just valid when the transfer request type is setting impact value as the parameter'
'401':
$ref: '#/components/responses/UnauthorizedError'
'/transfers/{transfer_id}/tokens':
Expand Down Expand Up @@ -468,6 +509,7 @@ paths:
description: ''
'401':
$ref: '#/components/responses/UnauthorizedError'
description: ''
/events:
get:
tags:
Expand Down Expand Up @@ -772,6 +814,12 @@ components:
type: string
capture:
type: string
value:
type: integer
description: impact value
value_matrix_id:
type: integer
description: The id of the impact value matrix
accountrequest:
title: accountrequest
required:
Expand Down Expand Up @@ -802,17 +850,13 @@ components:
type: integer
transferrequest:
title: transferrequest
required:
- tokens
- sender_wallet
- receiver_wallet
type: object
properties:
tokens:
type: array
description: ''
items:
type: string
description: ''
bundle:
type: object
properties:
Expand All @@ -832,12 +876,23 @@ components:
oneOf:
- type: string
- type: number
example:
tokens:
- e1b278e8-f025-44b7-9dd8-36ffb2d58f7e
- e533653e-2dbf-48cd-940a-a87e5a393158
sender_wallet: zaven4
receiver_wallet: zaven
impact:
type: object
description: Use impact value to express how many tokens should be tranfered
properties:
value:
type: integer
description: 'The totla amount of the impact value '
minimum: 0
maximum: 10000
accept_deviation:
type: boolean
description: 'If this transfer accept deviation when transfer happens, it means, when user choose to accept it, there might be some deviation between the actual transfered impact value and the value given here, the range of the deviation will be defined in the impact value matrix.'
default: true
required:
- tokens
- sender_wallet
- receiver_wallet
transferbundlerequest:
title: transferbundlerequest
required:
Expand Down Expand Up @@ -884,6 +939,16 @@ components:
sendRequestProcessedResponse:
title: sendRequestProcessedResponse
type: object
example:
originating_wallet: johnwallet1
source_wallet: planeter
destination_wallet: just.a.guy
type: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state: completed
created_at: '2020-07-09T00:41:49+00:00'
closed_at: '2020-07-09T00:41:49+00:00'
properties:
id:
type: string
Expand All @@ -906,16 +971,24 @@ components:
type: string
closed_at:
type: string
example:
originating_wallet: johnwallet1
source_wallet: planeter
destination_wallet: just.a.guy
type: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state: completed
created_at: '2020-07-09T00:41:49+00:00'
closed_at: '2020-07-09T00:41:49+00:00'
impact_value_transfered:
type: integer
description: 'The number of impact valued that has been actually transfered, this field is just valid when the transfer request type is setting impact value as the parameter'
Comment on lines +974 to +976
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZavenArra For the impact value transfer, I added the field called impact_value_transfered in the response, to indicate the actual impact value has been transferred in the transfer operation.
Also, I will return this field in the accept and fulfill endpoint if needed.
What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And @ZavenArra another question, should we need to set the value_matrix_id parameter for the impact value transfer?

'':
type: string
x-examples:
example-1:
value:
originating_wallet: johnwallet1
source_wallet: planeter
destination_wallet: just.a.guy
type: send
parameters:
$ref: '#/components/schemas/requestBundleRequestParameters'
state: completed
created_at: '2020-07-09T00:41:49+00:00'
closed_at: '2020-07-09T00:41:49+00:00'
description: ''
sendRequestPendingResponse:
title: sendRequestPendingResponse
sendBundleRequest:
Expand Down Expand Up @@ -969,17 +1042,19 @@ components:
properties:
tokens:
type: array
description: optional array of explicit tokens
items:
type: string
description: optional array of explicit tokens
bundle_size:
type: integer
description: required number of trees to transfer
matching_all_tags:
type: array
description: optional list of tags that trees must match ALL of
items:
type: string
description: optional list of tags that trees must match ALL of
impact:
type: object
required:
- bundle_size
requestBundleFulfillBody:
Expand Down