This repository was archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1037baf
Update ipfs_storage.py
ayshptk e305700
renamed image_uri -> image, still backwards compatible if image_uri k…
ayshptk acd35a5
Test for File Uploads
ayshptk 18e98f6
Update test_storage.py
ayshptk f3e0709
Merge branch 'master' into upload
ayshptk 5eeb230
Fixed environ var capture
atbe 2ddea1f
minor changes
ayshptk c50e1ac
implemented upload metadata method
ayshptk f1d0b23
minor changes
ayshptk 9e26946
added upload metadata to nft module
ayshptk a112ff5
minor changes, need to fix tests
ayshptk a693f82
fixed minor issues, encoding error still present
ayshptk 7bfd9ff
Fixed file uploading for image type
atbe 6590e7f
Cleaned up the upload_metadata function
atbe 124b36f
Updated all metadata uploading to go through the BaseModule.upload_me…
atbe dbe0419
renamed erc20->token, 721->nft, added check for `get_approval(tokenid…
ayshptk 7c3bccb
Update test_bundle.py
ayshptk 3a188a9
Update bundle.py
ayshptk b43b6af
Ensure all tests passing, fix constants import
atbe e99094a
Remove unused variable
atbe 2cb74b2
Merge branch 'master' into upload
atbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
TEST_NFT_CONTRACT_ADDRESS = "0xEeD541b524Ae738c48211Be91EB81E97739A0A29" | ||
TEST_NFT_CONTRACT_ADDRESS = "0xedd431613Ae5EF32D006F2Ad1fC229d939f86C64" | ||
TEST_PACK_CONTRACT_ADDRESS = "0x54ec360704b2e9E4e6499a732b78094D6d78e37B" | ||
TEST_MARKET_CONTRACT_ADDRESS = "0x325a98B6081ef88C6356d63c56f48Fa1d0d2DD0D" | ||
TEST_BUNDLE_CONTRACT_ADDRESS = "0x6Da734b14e4CE604f1e18efb7E7f7ef022e96616" | ||
TEST_BUNDLE_CONTRACT_ADDRESS = "0xc5392102B97496413fCCe4c823bF1F674856B382" | ||
TEST_CURRENCY_CONTRACT_ADDRESS = "0xF18FEb8b2F58691d67C98dB98B360840df340e74" | ||
|
||
TEST_COMPANION_WALLET_ADDRESS = "0x4d36d531D9cB40b8694763123D52170FAE5e1195" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
import unittest | ||
|
||
from thirdweb import MintArg, ThirdwebSdk, SdkOptions | ||
|
||
|
||
class TestStorage(unittest.TestCase): | ||
def test_storage(self): | ||
sdk = ThirdwebSdk(SdkOptions( | ||
private_key=os.environ['PKEY'] | ||
), "https://rpc-mumbai.maticvigil.com") | ||
|
||
nft_module = sdk.get_nft_module( | ||
"0xEeD541b524Ae738c48211Be91EB81E97739A0A29") | ||
|
||
# mint by uploading a file | ||
with open(file='tests/test.png', mode='rb') as f: | ||
content = f.read() | ||
module = nft_module.mint(MintArg(name="example", | ||
description="example nft!", image=content, properties={})) | ||
self.assertTrue(module.image.startswith( | ||
"ipfs://"), "Image files are expected to be uploaded when set in the image property") | ||
|
||
# mint by providing a string | ||
actual_image = "ipfs://QmYWi4mkEjsL6MYoS8z2ZWPAhyDPNjPQ2pqg8MGEM1CaeQ" | ||
module = nft_module.mint(MintArg(name="example", description="example nft!", | ||
image=actual_image, properties={})) | ||
self.assertEqual(module.image, actual_image, | ||
"String image properties should be uploaded as-is") | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.