Skip to content

Commit ae996e2

Browse files
committed
fix undefined setters
1 parent 2224a83 commit ae996e2

File tree

4 files changed

+426
-2
lines changed

4 files changed

+426
-2
lines changed

__fixtures__/assets2.json

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
{
2+
"$schema": "../assetlist.schema.json",
3+
"chain_name": "picasso",
4+
"assets": [
5+
{
6+
"description": "The native staking and governance token of Picasso Kusama.",
7+
"denom_units": [
8+
{
9+
"denom": "ppica",
10+
"exponent": 0
11+
},
12+
{
13+
"denom": "pica",
14+
"exponent": 12
15+
}
16+
],
17+
"type_asset": "substrate",
18+
"base": "ppica",
19+
"name": "Pica",
20+
"display": "pica",
21+
"symbol": "PICA",
22+
"logo_URIs": {
23+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/composable/images/pica.svg"
24+
},
25+
"images": [
26+
{
27+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/composable/images/pica.svg"
28+
}
29+
]
30+
},
31+
{
32+
"denom_units": [
33+
{
34+
"denom": "4",
35+
"exponent": 0
36+
},
37+
{
38+
"denom": "ksm",
39+
"exponent": 12
40+
}
41+
],
42+
"type_asset": "substrate",
43+
"base": "4",
44+
"name": "Kusama",
45+
"display": "ksm",
46+
"symbol": "KSM",
47+
"traces": [
48+
{
49+
"type": "bridge",
50+
"counterparty": {
51+
"chain_name": "kusama",
52+
"base_denom": "Planck"
53+
},
54+
"provider": "Kusama Parachain"
55+
}
56+
],
57+
"images": [
58+
{
59+
"image_sync": {
60+
"chain_name": "kusama",
61+
"base_denom": "Planck"
62+
},
63+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/kusama/images/ksm.svg"
64+
}
65+
],
66+
"logo_URIs": {
67+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/kusama/images/ksm.svg"
68+
}
69+
},
70+
{
71+
"denom_units": [
72+
{
73+
"denom": "79228162514264337593543950342",
74+
"exponent": 0
75+
},
76+
{
77+
"denom": "dot",
78+
"exponent": 10
79+
}
80+
],
81+
"type_asset": "substrate",
82+
"base": "79228162514264337593543950342",
83+
"name": "Polkadot",
84+
"display": "dot",
85+
"symbol": "DOT",
86+
"traces": [
87+
{
88+
"type": "ibc",
89+
"counterparty": {
90+
"chain_name": "composablepolkadot",
91+
"base_denom": "79228162514264337593543950342",
92+
"channel_id": "channel-15"
93+
},
94+
"chain": {
95+
"channel_id": "channel-15",
96+
"path": "transfer/channel-15/79228162514264337593543950342"
97+
}
98+
}
99+
],
100+
"images": [
101+
{
102+
"image_sync": {
103+
"chain_name": "composablepolkadot",
104+
"base_denom": "79228162514264337593543950342"
105+
},
106+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.svg",
107+
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.png"
108+
}
109+
],
110+
"logo_URIs": {
111+
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.png",
112+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.svg"
113+
}
114+
},
115+
{
116+
"denom_units": [
117+
{
118+
"denom": "130",
119+
"exponent": 0
120+
},
121+
{
122+
"denom": "usdt",
123+
"exponent": 6
124+
}
125+
],
126+
"type_asset": "substrate",
127+
"base": "130",
128+
"name": "Statemine",
129+
"display": "usdt",
130+
"symbol": "USDT",
131+
"traces": [
132+
{
133+
"type": "bridge",
134+
"counterparty": {
135+
"chain_name": "statemine",
136+
"base_denom": "130"
137+
},
138+
"provider": "Kusama Parachain"
139+
}
140+
],
141+
"images": [
142+
{
143+
"image_sync": {
144+
"chain_name": "statemine",
145+
"base_denom": "130"
146+
}
147+
}
148+
]
149+
},
150+
{
151+
"denom_units": [
152+
{
153+
"denom": "2125",
154+
"exponent": 0
155+
},
156+
{
157+
"denom": "TNKR",
158+
"exponent": 12
159+
}
160+
],
161+
"base": "2125",
162+
"name": "Tinkernet",
163+
"display": "TNKR",
164+
"symbol": "TNKR",
165+
"traces": [
166+
{
167+
"type": "bridge",
168+
"counterparty": {
169+
"chain_name": "tinkernet",
170+
"base_denom": "Planck"
171+
},
172+
"provider": "Tinkernet Parachain"
173+
}
174+
],
175+
"images": [
176+
{
177+
"image_sync": {
178+
"chain_name": "tinkernet",
179+
"base_denom": "Planck"
180+
},
181+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tinkernet/images/tnkr.svg"
182+
}
183+
],
184+
"logo_URIs": {
185+
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tinkernet/images/tnkr.svg"
186+
}
187+
}
188+
]
189+
}

__tests__/__snapshots__/default-values.test.ts.snap

+192
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,195 @@ exports[`defaultValue 1`] = `
124124
]
125125
}"
126126
`;
127+
128+
exports[`defaultValue undefined 1`] = `
129+
"{
130+
$schema: '../assetlist.schema.json',
131+
chainName: 'picasso',
132+
assets: [
133+
{
134+
description: 'The native staking and governance token of Picasso Kusama.',
135+
denomUnits: [
136+
{
137+
denom: 'ppica',
138+
exponent: 0
139+
},
140+
{
141+
denom: 'pica',
142+
exponent: 12
143+
}
144+
],
145+
assetType: 'substrate',
146+
base: 'ppica',
147+
name: 'Pica',
148+
display: 'pica',
149+
symbol: 'PICA',
150+
logoURIs: {
151+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/composable/images/pica.svg'
152+
},
153+
images: [
154+
{
155+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/composable/images/pica.svg'
156+
}
157+
]
158+
},
159+
{
160+
denomUnits: [
161+
{
162+
denom: '4',
163+
exponent: 0
164+
},
165+
{
166+
denom: 'ksm',
167+
exponent: 12
168+
}
169+
],
170+
assetType: 'substrate',
171+
base: '4',
172+
name: 'Kusama',
173+
display: 'ksm',
174+
symbol: 'KSM',
175+
traces: [
176+
{
177+
type: 'bridge',
178+
counterparty: {
179+
chainName: 'kusama',
180+
baseDenom: 'Planck'
181+
},
182+
provider: 'Kusama Parachain'
183+
}
184+
],
185+
images: [
186+
{
187+
imageSync: {
188+
chainName: 'kusama',
189+
baseDenom: 'Planck'
190+
},
191+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/kusama/images/ksm.svg'
192+
}
193+
],
194+
logoURIs: {
195+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/kusama/images/ksm.svg'
196+
}
197+
},
198+
{
199+
denomUnits: [
200+
{
201+
denom: '79228162514264337593543950342',
202+
exponent: 0
203+
},
204+
{
205+
denom: 'dot',
206+
exponent: 10
207+
}
208+
],
209+
assetType: 'substrate',
210+
base: '79228162514264337593543950342',
211+
name: 'Polkadot',
212+
display: 'dot',
213+
symbol: 'DOT',
214+
traces: [
215+
{
216+
type: 'ibc',
217+
counterparty: {
218+
chainName: 'composablepolkadot',
219+
baseDenom: '79228162514264337593543950342',
220+
channelId: 'channel-15'
221+
},
222+
chain: {
223+
channelId: 'channel-15',
224+
path: 'transfer/channel-15/79228162514264337593543950342'
225+
}
226+
}
227+
],
228+
images: [
229+
{
230+
imageSync: {
231+
chainName: 'composablepolkadot',
232+
baseDenom: '79228162514264337593543950342'
233+
},
234+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.svg',
235+
png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.png'
236+
}
237+
],
238+
logoURIs: {
239+
png: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.png',
240+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/polkadot/images/dot.svg'
241+
}
242+
},
243+
{
244+
denomUnits: [
245+
{
246+
denom: '130',
247+
exponent: 0
248+
},
249+
{
250+
denom: 'usdt',
251+
exponent: 6
252+
}
253+
],
254+
assetType: 'substrate',
255+
base: '130',
256+
name: 'Statemine',
257+
display: 'usdt',
258+
symbol: 'USDT',
259+
traces: [
260+
{
261+
type: 'bridge',
262+
counterparty: {
263+
chainName: 'statemine',
264+
baseDenom: '130'
265+
},
266+
provider: 'Kusama Parachain'
267+
}
268+
],
269+
images: [
270+
{
271+
imageSync: {
272+
chainName: 'statemine',
273+
baseDenom: '130'
274+
}
275+
}
276+
]
277+
},
278+
{
279+
denomUnits: [
280+
{
281+
denom: '2125',
282+
exponent: 0
283+
},
284+
{
285+
denom: 'TNKR',
286+
exponent: 12
287+
}
288+
],
289+
base: '2125',
290+
name: 'Tinkernet',
291+
display: 'TNKR',
292+
symbol: 'TNKR',
293+
traces: [
294+
{
295+
type: 'bridge',
296+
counterparty: {
297+
chainName: 'tinkernet',
298+
baseDenom: 'Planck'
299+
},
300+
provider: 'Tinkernet Parachain'
301+
}
302+
],
303+
images: [
304+
{
305+
imageSync: {
306+
chainName: 'tinkernet',
307+
baseDenom: 'Planck'
308+
},
309+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tinkernet/images/tnkr.svg'
310+
}
311+
],
312+
logoURIs: {
313+
svg: 'https://raw.githubusercontent.com/cosmos/chain-registry/master/_non-cosmos/tinkernet/images/tnkr.svg'
314+
}
315+
}
316+
]
317+
}"
318+
`;

0 commit comments

Comments
 (0)