Skip to content

Commit

Permalink
add nftoken and clawback tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed May 7, 2024
1 parent 7f4ee18 commit fe8ba3b
Show file tree
Hide file tree
Showing 40 changed files with 239 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/src/test_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ static const char *testcases[] = {
"../testcases/18-arrays/01-basic.raw",
"../testcases/18-arrays/02-multiple.raw",
"../testcases/18-arrays/03-not-last.raw",
"../testcases/19-nftoken-mint/01-basic.raw",
"../testcases/19-nftoken-mint/02-burnable.raw",
"../testcases/19-nftoken-mint/03-only-xrp.raw",
"../testcases/19-nftoken-mint/04-transferable.raw",
"../testcases/20-nftoken-burn/01-basic.raw",
"../testcases/21-nftoken-create-offer/01-sell.raw",
"../testcases/21-nftoken-create-offer/02-sell-destination.raw",
"../testcases/21-nftoken-create-offer/03-buy.raw",
"../testcases/21-nftoken-create-offer/04-buy-expiration.raw",
"../testcases/22-nftoken-cancel-offer/01-basic.raw",
"../testcases/23-nftoken-accept-offer/01-basic.raw",
"../testcases/23-nftoken-accept-offer/01-broker.raw",
"../testcases/24-clawback/01-basic.raw",
NULL,
};

Expand Down
10 changes: 10 additions & 0 deletions tests/testcases/19-nftoken-mint/01-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"TransactionType": "NFTokenMint",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 0,
"URI": "697066733A2F2F6261736963",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY",
"NFTokenTaxon": 0
}
Binary file added tests/testcases/19-nftoken-mint/01-basic.raw
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testcases/19-nftoken-mint/01-basic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Transaction Type; NFToken Mint
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Taxon; 0
Fee; XRP 0.000015
URI; ipfs://basic
10 changes: 10 additions & 0 deletions tests/testcases/19-nftoken-mint/02-burnable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"TransactionType": "NFTokenMint",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 1,
"URI": "697066733A2F2F6261736963",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY",
"NFTokenTaxon": 0
}
Binary file added tests/testcases/19-nftoken-mint/02-burnable.raw
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testcases/19-nftoken-mint/02-burnable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Transaction Type; NFToken Mint
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Taxon; 0
Fee; XRP 0.000015
URI; ipfs://basic
10 changes: 10 additions & 0 deletions tests/testcases/19-nftoken-mint/03-only-xrp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"TransactionType": "NFTokenMint",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 2,
"URI": "697066733A2F2F6261736963",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY",
"NFTokenTaxon": 0
}
Binary file added tests/testcases/19-nftoken-mint/03-only-xrp.raw
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testcases/19-nftoken-mint/03-only-xrp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Transaction Type; NFToken Mint
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Taxon; 0
Fee; XRP 0.000015
URI; ipfs://basic
10 changes: 10 additions & 0 deletions tests/testcases/19-nftoken-mint/04-transferable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"TransactionType": "NFTokenMint",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 8,
"URI": "697066733A2F2F6261736963",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY",
"NFTokenTaxon": 0
}
Binary file added tests/testcases/19-nftoken-mint/04-transferable.raw
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testcases/19-nftoken-mint/04-transferable.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Transaction Type; NFToken Mint
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Taxon; 0
Fee; XRP 0.000015
URI; ipfs://basic
9 changes: 9 additions & 0 deletions tests/testcases/20-nftoken-burn/01-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"TransactionType": "NFTokenBurn",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 0,
"NFTokenID": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/20-nftoken-burn/01-basic.raw
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/testcases/20-nftoken-burn/01-basic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Transaction Type; NFToken Burn
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token I D; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Fee; XRP 0.000015
14 changes: 14 additions & 0 deletions tests/testcases/21-nftoken-create-offer/01-sell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"TransactionType": "NFTokenCreateOffer",
"Account": "OWN_ADDR",
"NFTokenID": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Amount": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "314.159"
},
"Fee": "15",
"Flags": 1,
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/21-nftoken-create-offer/01-sell.raw
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/testcases/21-nftoken-create-offer/01-sell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Transaction Type; NFToken Create Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token I D; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Amount; FOO 314.159
Issuer; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
Fee; XRP 0.000015
15 changes: 15 additions & 0 deletions tests/testcases/21-nftoken-create-offer/02-sell-destination.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"TransactionType": "NFTokenCreateOffer",
"Account": "OWN_ADDR",
"NFTokenID": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Amount": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "314.159"
},
"Destination": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"Fee": "15",
"Flags": 1,
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Transaction Type; NFToken Create Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token I D; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Amount; FOO 314.159
Issuer; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
Fee; XRP 0.000015
Destination; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
14 changes: 14 additions & 0 deletions tests/testcases/21-nftoken-create-offer/03-buy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"TransactionType": "NFTokenCreateOffer",
"Account": "OWN_ADDR",
"NFTokenID": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Owner": "ra7Zr8ddy9tB88RaXL8B87YkqhEJG2vkAJ",
"Amount": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "314.159"
},
"Fee": "15",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/21-nftoken-create-offer/03-buy.raw
Binary file not shown.
7 changes: 7 additions & 0 deletions tests/testcases/21-nftoken-create-offer/03-buy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Transaction Type; NFToken Create Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token I D; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Amount; FOO 314.159
Issuer; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
Fee; XRP 0.000015
Owner; ra7Zr8ddy9tB 88RaXL8B87Y kqhEJG2vkAJ
15 changes: 15 additions & 0 deletions tests/testcases/21-nftoken-create-offer/04-buy-expiration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"TransactionType": "NFTokenCreateOffer",
"Account": "OWN_ADDR",
"NFTokenID": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Owner": "ra7Zr8ddy9tB88RaXL8B87YkqhEJG2vkAJ",
"Amount": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "314.159"
},
"Fee": "15",
"Sequence": 3,
"Expiration": 570113521,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file not shown.
8 changes: 8 additions & 0 deletions tests/testcases/21-nftoken-create-offer/04-buy-expiration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Transaction Type; NFToken Create Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
Expiration; 2018-01-24 12:52:01 UTC
N F Token I D; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Amount; FOO 314.159
Issuer; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
Fee; XRP 0.000015
Owner; ra7Zr8ddy9tB 88RaXL8B87Y kqhEJG2vkAJ
12 changes: 12 additions & 0 deletions tests/testcases/22-nftoken-cancel-offer/01-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"TransactionType": "NFTokenCancelOffer",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 0,
"NFTokenOffers": [
"9C92E061381C1EF37A8CDE0E8FC35188BFC30B1883825042A64309AC09F4C36D",
"000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052"
],
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/22-nftoken-cancel-offer/01-basic.raw
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/testcases/22-nftoken-cancel-offer/01-basic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Transaction Type; NFToken Cancel Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
Fee; XRP 0.000015
N F Token Offers; 9C92E061381C1EF37A8CDE0E8FC35188BFC30B1883825042A64309AC09F4C36D,000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
9 changes: 9 additions & 0 deletions tests/testcases/23-nftoken-accept-offer/01-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"TransactionType": "NFTokenAcceptOffer",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 0,
"NFTokenSellOffer": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/23-nftoken-accept-offer/01-basic.raw
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/testcases/23-nftoken-accept-offer/01-basic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Transaction Type; NFToken Accept Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Sell Offer; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Fee; XRP 0.000015
15 changes: 15 additions & 0 deletions tests/testcases/23-nftoken-accept-offer/02-broker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"TransactionType": "NFTokenAcceptOffer",
"Account": "OWN_ADDR",
"Fee": "15",
"Flags": 0,
"NFTokenSellOffer": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"NFTokenBuyOffer": "000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052",
"NFTokenBrokerFee": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "1"
},
"Sequence": 3,
"SigningPubKey": "OWN_PUBKEY"
}
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/testcases/23-nftoken-accept-offer/02-broker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Transaction Type; NFToken Accept Offer
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
N F Token Buy Offer; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
N F Token Sell Offer; 000000003C0E955DFA24367806070434D8BE16A12E410C3B559CFBED00000052
Fee; XRP 0.000015
N F Token Broker Fee; [object Object]
12 changes: 12 additions & 0 deletions tests/testcases/24-clawback/01-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"TransactionType": "Clawback",
"Account": "OWN_ADDR",
"Fee": "10",
"Flags": 0,
"Amount": {
"currency": "FOO",
"issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"value": "314.159"
},
"SigningPubKey": "OWN_PUBKEY"
}
Binary file added tests/testcases/24-clawback/01-basic.raw
Binary file not shown.
5 changes: 5 additions & 0 deletions tests/testcases/24-clawback/01-basic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Transaction Type; Clawback
Account; rTooLkitCks h5mQa67eaa2 JaWHDBnHkpy
Amount; FOO 314.159
Issuer; rsA2Lpzuawew SBQXkiju3YQ TMzW13pAAdW
Fee; XRP 0.00001

0 comments on commit fe8ba3b

Please sign in to comment.