mirror of
https://github.com/Instadapp/Swap-Aggregator-Subgraph.git
synced 2024-07-29 21:57:12 +00:00
235 lines
4.7 KiB
JavaScript
235 lines
4.7 KiB
JavaScript
const cliTest = require('./util').cliTest
|
|
|
|
describe('Validation', () => {
|
|
cliTest(
|
|
'Invalid subgraph manifest',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-manifest',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Invalid subgraph manifest (cannot infer protocol)',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-manifest-cannot-infer-protocol',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'ABI not found in data source',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/abi-not-found',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Invalid ABI files',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-abis',
|
|
{ exitCode: 1 },
|
|
)
|
|
cliTest(
|
|
'Event not found in ABI',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/event-not-found',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Call function not found in the ABI',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/call-function-not-found',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Call handler with tuple',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/call-handler-with-tuple',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Missing entity "id" field',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/missing-entity-id',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Invalid entity field types',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-entity-field-types',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Invalid contract addresses',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-contract-addresses',
|
|
)
|
|
cliTest(
|
|
'Entity field arguments',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/entity-field-args',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Example values found in manifest',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/example-values-found',
|
|
{ exitCode: 0 },
|
|
)
|
|
cliTest(
|
|
'Source without address is valid',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/source-without-address-is-valid',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Invalid data source template',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-data-source-template',
|
|
{ exitCode: 1 },
|
|
)
|
|
cliTest(
|
|
'BigDecimal is a valid type',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/big-decimal-is-valid',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'topic0 is valid in an event handler',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/topic0-is-valid',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Ethereum contract data source without handlers',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/ethereum-contract-without-handlers',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Missing or invalid @derivedFrom fields',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/missing-or-invalid-derived-from-fields',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Deriving from interface-typed fields is allowed',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/derived-from-with-interface',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'@derivedFrom target type missing',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/derived-from-target-type-missing',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
cliTest(
|
|
'NEAR is a valid chain',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/near-is-valid',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
cliTest(
|
|
'Deprecated template format gives nice error',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/nested-template-nice-error',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Duplicate data source name',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/duplicate-data-source-name',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Duplicate template name',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/duplicate-template-name',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'No network names (valid)',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/no-network-names',
|
|
{
|
|
exitCode: 0,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Conflicting network names',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/conflicting-network-names',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Conflicting protocol names',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/conflicting-protocol-names',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Invalid @fulltext directive',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-fulltext-directive',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
|
|
cliTest(
|
|
'Invalid GraphQL schema',
|
|
['codegen', '--skip-migrations'],
|
|
'validation/invalid-graphql-schema',
|
|
{
|
|
exitCode: 1,
|
|
},
|
|
)
|
|
})
|