Created
August 28, 2018 10:11
-
-
Save CosminNechifor/896fc011c0f6c3d21f5da2204920df73 to your computer and use it in GitHub Desktop.
Script I've used to send the payments
This file contains 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
import requests | |
import click | |
def perform_request(token_address, partner_address, transaction_num): | |
url = f'http://localhost:5001/api/1/payments/{token_address}/{partner_address}' | |
print(f'post on:{url}') | |
requests.post( | |
url, | |
headers={'Content-Type': 'application/json'}, | |
json={'amount': 1}, | |
) | |
print('Post executed') | |
@click.command() | |
@click.option('--token_address', | |
default='0x0f114A1E9Db192502E7856309cc899952b3db1ED', | |
metavar='string' | |
) | |
@click.option('--partner_address', | |
metavar='string', | |
default='0x2A93dd057fFBa07d0DAFFfbfA534C09e457c40d7', | |
) | |
def run( | |
token_address, | |
partner_address, | |
): | |
for i in range(0, 200): | |
perform_request(token_address, partner_address, i) | |
if __name__ == '__main__': | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment