File tree 2 files changed +23
-9
lines changed
services/decoder/protocols/defi-kingdoms
2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ GoldRushDecoder.on(
99
99
100
100
const date = TimestampParser ( tx . block_signed_at , "YYYY-MM-DD" ) ;
101
101
102
- // INFO: Fetching Jewel Token Price from Avalanche Mainnet as it is a native token on Defi Kingdoms
102
+ // * INFO: Fetching Jewel Token Price from Avalanche Mainnet as it is a native token on Defi Kingdoms
103
103
104
104
const { data : JewelToken } =
105
105
await covalent_client . PricingService . getTokenPrices (
@@ -115,7 +115,8 @@ GoldRushDecoder.on(
115
115
const { data : HeroNFT } =
116
116
await covalent_client . NftService . getNftMetadataForGivenTokenIdForContract (
117
117
chain_name ,
118
- "0xEb9B61B145D6489Be575D3603F4a704810e143dF" , // Hero NFT Contract Address
118
+ // * INFO: Hero NFT Contract Address
119
+ "0xEb9B61B145D6489Be575D3603F4a704810e143dF" ,
119
120
decoded . tokenId . toString ( ) ,
120
121
{
121
122
withUncached : true ,
@@ -203,11 +204,9 @@ GoldRushDecoder.on(
203
204
{
204
205
heading : "Winner" ,
205
206
value : ! isNullAddress ( decoded . winner )
206
- ? decoded . winner
207
- : "No winner" ,
208
- type : ! isNullAddress ( decoded . winner )
209
- ? "address"
210
- : "text" ,
207
+ ? decoded . winner
208
+ : "No winner" ,
209
+ type : ! isNullAddress ( decoded . winner ) ? "address" : "text" ,
211
210
} ,
212
211
] ;
213
212
Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ describe("defi-kingdoms", () => {
34
34
if ( ! event ) {
35
35
throw Error ( "Event not found" ) ;
36
36
}
37
- expect ( event ?. details ?. length ) . toEqual ( 7 ) ;
37
+ if ( event . nfts ) {
38
+ expect ( event . nfts ?. length ) . toBeGreaterThan ( 0 ) ;
39
+ }
40
+ if ( event . tokens ) {
41
+ expect ( event . tokens ?. length ) . toBeGreaterThan ( 0 ) ;
42
+ }
43
+ expect ( event ?. details ?. length ) . toEqual ( 5 ) ;
38
44
} ) ;
39
45
40
46
test ( "defi-kingdoms-mainnet:Auction Cancelled" , async ( ) => {
@@ -51,6 +57,9 @@ describe("defi-kingdoms", () => {
51
57
if ( ! event ) {
52
58
throw Error ( "Event not found" ) ;
53
59
}
60
+ if ( event . nfts ) {
61
+ expect ( event . nfts ?. length ) . toBeGreaterThan ( 0 ) ;
62
+ }
54
63
expect ( event ?. details ?. length ) . toEqual ( 2 ) ;
55
64
} ) ;
56
65
@@ -68,6 +77,12 @@ describe("defi-kingdoms", () => {
68
77
if ( ! event ) {
69
78
throw Error ( "Event not found" ) ;
70
79
}
71
- expect ( event ?. details ?. length ) . toEqual ( 4 ) ;
80
+ if ( event . nfts ) {
81
+ expect ( event . nfts ?. length ) . toBeGreaterThan ( 0 ) ;
82
+ }
83
+ if ( event . tokens ) {
84
+ expect ( event . tokens ?. length ) . toBeGreaterThan ( 0 ) ;
85
+ }
86
+ expect ( event ?. details ?. length ) . toEqual ( 3 ) ;
72
87
} ) ;
73
88
} ) ;
You can’t perform that action at this time.
0 commit comments