Skip to content

Lesson 7: Using Mocks #1830

Answered by Nlferu
kailashchoudhary11 asked this question in Q&A
Jan 31, 2023 · 1 comments · 13 replies
Discussion options

You must be logged in to vote

Hi @kailashchoudhary11

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

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@cromewar
Comment options

@kailashchoudhary11
Comment options

@cromewar
Comment options

@Nlferu
Comment options

@kailashchoudhary11
Comment options

Answer selected by kailashchoudhary11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants