Lesson 7: Using Mocks #1830
Answered
by
Nlferu
kailashchoudhary11
asked this question in
Q&A
Lesson 7: Using Mocks
#1830
-
How do I get the sub_id after deploying VRFCordinatorMock? |
Beta Was this translation helpful? Give feedback.
Answered by
Nlferu
Jan 31, 2023
Replies: 1 comment 13 replies
-
You can do below to get sub_id: # Creating Subscription And Getting SubscriptionId...
create_sub_tx = vrfCoordinatorV2Mock.createSubscription()
create_sub_tx.wait(1)
subId = create_sub_tx.return_value
# Second way to get subscription id
subID = create_sub_tx.events["SubscriptionCreated"]["subId"]
print(f'SubscriptionId: {subId, subID}') Just note that sub_id is used in VRF_V2 not in previous 1st version. You can also take a look at my whole lottery on VRF_V2 here: https://github.com/Neftyr/Lottery-On-VRFConsumerBaseV2-Python |
Beta Was this translation helpful? Give feedback.
13 replies
Answer selected by
kailashchoudhary11
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @kailashchoudhary11
You can do below to get sub_id:
Just note that sub_id is used in VRF_V2 not in previous 1st version. You can also take a look at my whole lottery on VRF_V2 here: https://github.com/Neftyr/Lottery-On-VRFConsumerBaseV2-Python