Skip to content

Commit

Permalink
fix(claims): add cw20 payments to evaluation type and fill in on Eval…
Browse files Browse the repository at this point in the history
…uateClaim
  • Loading branch information
Michael-Ixo committed Oct 1, 2024
1 parent cf66ab2 commit 347c925
Show file tree
Hide file tree
Showing 7 changed files with 316 additions and 111 deletions.
12 changes: 9 additions & 3 deletions docs/core/proto-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -5478,9 +5478,15 @@ <h3 id="ixo.claims.v1beta1.Evaluation">Evaluation</h3>
<td><a href="#cosmos.base.v1beta1.Coin">cosmos.base.v1beta1.Coin</a></td>
<td>repeated</td>
<td><p>custom amount specified by evaluator for claim approval, if empty list then
use default by Collection

TODO: add custom cw20 payments? </p></td>
use default by Collection </p></td>
</tr>

<tr>
<td>cw20_payment</td>
<td><a href="#ixo.claims.v1beta1.CW20Payment">CW20Payment</a></td>
<td>repeated</td>
<td><p>custom cw20 payments specified by evaluator for claim approval, if empty
list then use default by Collection </p></td>
</tr>

</tbody>
Expand Down
14 changes: 13 additions & 1 deletion docs/core/proto-docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,7 @@
},
{
"name": "amount",
"description": "custom amount specified by evaluator for claim approval, if empty list then\nuse default by Collection\n\nTODO: add custom cw20 payments?",
"description": "custom amount specified by evaluator for claim approval, if empty list then\nuse default by Collection",
"label": "repeated",
"type": "Coin",
"longType": "cosmos.base.v1beta1.Coin",
Expand All @@ -4779,6 +4779,18 @@
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
},
{
"name": "cw20_payment",
"description": "custom cw20 payments specified by evaluator for claim approval, if empty\nlist then use default by Collection",
"label": "repeated",
"type": "CW20Payment",
"longType": "CW20Payment",
"fullType": "ixo.claims.v1beta1.CW20Payment",
"ismap": false,
"isoneof": false,
"oneofdecl": "",
"defaultValue": ""
}
]
},
Expand Down
5 changes: 2 additions & 3 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1934,9 +1934,8 @@ Msg defines the bonds Msg service.
| reason | [uint32](#uint32) | | reason is the code expressed as an integer, for why the evaluation result was given (codes defined by evaluator) |
| verification_proof | [string](#string) | | verificationProof is the cid of the evaluation Verfiable Credential |
| evaluation_date | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | evaluationDate is the date and time that the claim evaluation was submitted on-chain |
| amount | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | custom amount specified by evaluator for claim approval, if empty list then use default by Collection

TODO: add custom cw20 payments? |
| amount | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | custom amount specified by evaluator for claim approval, if empty list then use default by Collection |
| cw20_payment | [CW20Payment](#ixo.claims.v1beta1.CW20Payment) | repeated | custom cw20 payments specified by evaluator for claim approval, if empty list then use default by Collection |



Expand Down
120 changes: 120 additions & 0 deletions docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50744,6 +50744,26 @@ paths:
approval, if empty list then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be
small enough to fit in a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for
claim approval, if empty

list then use default by Collection
payments_status:
type: object
properties:
Expand Down Expand Up @@ -51017,6 +51037,26 @@ paths:
approval, if empty list then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be small
enough to fit in a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for claim
approval, if empty

list then use default by Collection
payments_status:
type: object
properties:
Expand Down Expand Up @@ -86733,6 +86773,26 @@ definitions:
list then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be small enough to
fit in a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for claim approval, if
empty

list then use default by Collection
payments_status:
type: object
properties:
Expand Down Expand Up @@ -87282,6 +87342,26 @@ definitions:
then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be small enough to fit in
a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for claim approval, if
empty

list then use default by Collection
ixo.claims.v1beta1.EvaluationStatus:
type: string
enum:
Expand Down Expand Up @@ -87725,6 +87805,26 @@ definitions:
empty list then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be small enough
to fit in a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for claim
approval, if empty

list then use default by Collection
payments_status:
type: object
properties:
Expand Down Expand Up @@ -87904,6 +88004,26 @@ definitions:
empty list then

use default by Collection
cw20_payment:
type: array
items:
type: object
properties:
address:
type: string
amount:
type: string
format: uint64
title: >-
chose uint64 for now as amounts should be small enough
to fit in a

uint64(max 18446744073709551615)
title: >-
custom cw20 payments specified by evaluator for claim
approval, if empty

list then use default by Collection
payments_status:
type: object
properties:
Expand Down
4 changes: 3 additions & 1 deletion proto/ixo/claims/v1beta1/claims.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ message Evaluation {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// TODO: add custom cw20 payments?
// custom cw20 payments specified by evaluator for claim approval, if empty
// list then use default by Collection
repeated CW20Payment cw20_payment = 11;
}

message Dispute {
Expand Down
2 changes: 2 additions & 0 deletions x/claims/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ func (s msgServer) EvaluateClaim(goCtx context.Context, msg *types.MsgEvaluateCl
Reason: msg.Reason,
VerificationProof: msg.VerificationProof,
EvaluationDate: &evaluationDate,
Amount: msg.Amount,
Cw20Payment: msg.Cw20Payment,
}

claim.Evaluation = &evaluation
Expand Down
Loading

0 comments on commit 347c925

Please sign in to comment.