Skip to content

Commit

Permalink
Refactor metadata arrays to use empty cells
Browse files Browse the repository at this point in the history
  • Loading branch information
d0rich committed Nov 17, 2023
1 parent 5e3ad06 commit 161c434
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions contracts/contracts/d_social_network_account.tact
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ contract DSocialNetworkAccount with NftCollection, NftCollectionRoyaltyExtention
self.collection_content = NftCollectionMetadata{
image: "",
name: "",
description: "",
social_links: emptyCell()
description: ""
};
}

Expand Down
5 changes: 2 additions & 3 deletions contracts/contracts/d_social_network_master.tact
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "./messages_d.tact";
import "./d_social_network_account.tact";

contract DSocialNetworkMaster with Deployable, OwnableTransferable, Accounting {
version: String = "v0.0.1-metadata-arrays-as-empty-cells";
version: String = "v0.0.1-no-metadata-arrays";
owner: Address;
next_account_index: Int as uint32 = 0;

Expand Down Expand Up @@ -56,8 +56,7 @@ contract DSocialNetworkMaster with Deployable, OwnableTransferable, Accounting
return NftCollectionMetadata{
image: "some-image-link",
name: msg.account_name,
description: msg.account_description,
social_links: emptyCell()
description: msg.account_description
};
}
}
3 changes: 1 addition & 2 deletions contracts/contracts/d_social_network_post.tact
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ contract DSocialNetworkPost with NftItem {
image: "",
name: "",
description: "",
content_url: "",
attributes: emptyCell()
content_url: ""
};
self.is_initialized = false;
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/contracts/lib/messages_nft.tact
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ struct NftCollectionMetadata {
image: String;
name: String;
description: String;
social_links: Cell;
}

message MintNft {
Expand Down Expand Up @@ -49,7 +48,6 @@ struct NftMetadata {
description: String;
image: String;
content_url: String;
attributes: Cell;
}

message InitializeNft {
Expand Down
5 changes: 2 additions & 3 deletions contracts/scripts/deployTestSocialNetwork.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toNano, Cell } from 'ton-core'
import { toNano } from 'ton-core'
import { NetworkProvider } from '@ton-community/blueprint'
import { DSocialNetworkMaster } from '../wrappers/DSocialNetworkMaster'
import { DSocialNetworkAccount } from '../wrappers/DSocialNetworkAccount'
Expand Down Expand Up @@ -50,8 +50,7 @@ export async function run(provider: NetworkProvider) {
name: 'Test post',
description: 'Test post description',
image: 'https://test.com/image.png',
content_url: 'https://test.com/content.txt',
attributes: Cell.EMPTY
content_url: 'https://test.com/content.txt'
}
}
)
Expand Down
5 changes: 2 additions & 3 deletions contracts/tests/DSocialNetworkAccount.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Blockchain, SandboxContract } from '@ton-community/sandbox'
import { Cell, toNano } from 'ton-core'
import { toNano } from 'ton-core'
import { DSocialNetworkMaster } from '../wrappers/DSocialNetworkMaster'
import { DSocialNetworkAccount } from '../wrappers/DSocialNetworkAccount'
import '@ton-community/test-utils'
Expand Down Expand Up @@ -77,8 +77,7 @@ describe('DSocialNetworkMaster', () => {
name: 'Test post',
description: 'Test post description',
image: 'https://test.com/image.png',
content_url: 'https://test.com/content.txt',
attributes: Cell.EMPTY
content_url: 'https://test.com/content.txt'
}
}
)
Expand Down

0 comments on commit 161c434

Please sign in to comment.