@@ -190,10 +190,9 @@ describe('GNS', () => {
190190
191191 // Check what selling all nSignal, which == selling all vSignal, should return for tokens
192192 // NOTE - no tax on burning on nSignal
193- const { 1 : tokensReceivedEstimate } = await gns . nSignalToTokens (
194- subgraphID ,
195- beforeSubgraph . nSignal ,
196- )
193+ const tokensReceivedEstimate = beforeSubgraph . nSignal . gt ( 0 )
194+ ? ( await gns . nSignalToTokens ( subgraphID , beforeSubgraph . nSignal ) ) [ 1 ]
195+ : toBN ( 0 )
197196 // Example:
198197 // Deposit 100, 5 is taxed, 95 GRT in curve
199198 // Upgrade - calculate 5% tax on 95 --> 4.75 GRT
@@ -211,10 +210,10 @@ describe('GNS', () => {
211210 const totalAdjustedUp = totalWithOwnerTax . mul ( MAX_PPM ) . div ( MAX_PPM - curationTaxPercentage )
212211
213212 // Re-estimate amount of signal to get considering the owner tax paid by the owner
214- const { 0 : newVSignalEstimate , 1 : newCurationTaxEstimate } = await curation . tokensToSignal (
215- newSubgraph . subgraphDeploymentID ,
216- totalAdjustedUp ,
217- )
213+
214+ const { 0 : newVSignalEstimate , 1 : newCurationTaxEstimate } = beforeSubgraph . nSignal . gt ( 0 )
215+ ? await curation . tokensToSignal ( newSubgraph . subgraphDeploymentID , totalAdjustedUp )
216+ : [ toBN ( 0 ) , toBN ( 0 ) ]
218217
219218 // Send tx
220219 const tx = gns
@@ -620,6 +619,11 @@ describe('GNS', () => {
620619 await publishNewVersion ( me , subgraph . id , newSubgraph1 )
621620 } )
622621
622+ it ( 'should publish a new version on an existing subgraph with no current signal' , async function ( ) {
623+ const emptySignalSubgraph = await publishNewSubgraph ( me , buildSubgraph ( ) )
624+ await publishNewVersion ( me , emptySignalSubgraph . id , newSubgraph1 )
625+ } )
626+
623627 it ( 'should reject a new version with the same subgraph deployment ID' , async function ( ) {
624628 const tx = gns
625629 . connect ( me . signer )
0 commit comments