@@ -190,10 +190,9 @@ describe('GNS', () => {
190
190
191
191
// Check what selling all nSignal, which == selling all vSignal, should return for tokens
192
192
// 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 )
197
196
// Example:
198
197
// Deposit 100, 5 is taxed, 95 GRT in curve
199
198
// Upgrade - calculate 5% tax on 95 --> 4.75 GRT
@@ -211,10 +210,10 @@ describe('GNS', () => {
211
210
const totalAdjustedUp = totalWithOwnerTax . mul ( MAX_PPM ) . div ( MAX_PPM - curationTaxPercentage )
212
211
213
212
// 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 ) ]
218
217
219
218
// Send tx
220
219
const tx = gns
@@ -620,6 +619,11 @@ describe('GNS', () => {
620
619
await publishNewVersion ( me , subgraph . id , newSubgraph1 )
621
620
} )
622
621
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
+
623
627
it ( 'should reject a new version with the same subgraph deployment ID' , async function ( ) {
624
628
const tx = gns
625
629
. connect ( me . signer )
0 commit comments