Skip to content

Commit

Permalink
TMP Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed Aug 12, 2024
1 parent f78ef74 commit 6a381fb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 74 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pJwMe4��B������_Hello Badger
Binary file not shown.
6 changes: 3 additions & 3 deletions rosetta-cli-conf/kava-localnet-ci/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"network": "kava-localnet"
},
"online_url": "http://localhost:8000",
"data_directory": "./rosetta-cli-conf/cache",
"data_directory": "./rosetta-cli-conf/cache2",
"http_timeout": 30,
"max_retries": 25,
"retry_elapsed_time": 0,
Expand All @@ -31,9 +31,9 @@
"initial_balance_fetch_disabled": false,
"prefunded_accounts": [
{
"privkey": "6034eb3856dd7cca4b5d9bfc5f262ab155d967dc2f8b78485eae6a7cbb5e7c51",
"privkey": "aa50f4c6c15190d9e18bf8b14fc09bfba0e7306331a4f232d10a77c2879e7966",
"account_identifier": {
"address": "kava173w2zz287s36ewnnkf4mjansnthnnsz7rtrxqc"
"address": "kava1q0dkky0505r555etn6u2nz4h4kjcg5y8dg863a"
},
"curve_type": "secp256k1",
"currency":{
Expand Down
76 changes: 7 additions & 69 deletions rosetta-cli-conf/kava-localnet-ci/kava.ros
Original file line number Diff line number Diff line change
@@ -1,25 +1,3 @@
request_funds(1){
find_account{
currency = {"symbol":"KAVA", "decimals":6};
random_account = find_balance({
"minimum_balance": {
"value": "0",
"currency": {{currency}}
},
"create_limit":1
});
},
request{
loaded_account = find_balance({
"account_identifier": {{random_account.account_identifier}},
"minimum_balance":{
"value": "1000000",
"currency": {{currency}}
}
});
}
}

create_account(1){
create{
network = set_variable({"network":"kava-localnet", "blockchain":"Kava"});
Expand All @@ -35,7 +13,7 @@ create_account(1){
}
}

transfer(10){
transfer(1){
transfer{
transfer.network = set_variable({"network":"kava-localnet", "blockchain":"Kava"});
currency = {"symbol":"KAVA", "decimals":6};
Expand All @@ -46,11 +24,13 @@ transfer(10){
}
});

print_message({"sender":{{sender}}});

// Set the recipient_amount as some value <= sender.balance-max_fee
max_fee = "1000";
available_amount = {{sender.balance.value}} - {{max_fee}};
recipient_amount = random_number({"minimum": "1", "maximum": {{available_amount}}});
recipient_amount = "1001";
print_message({"recipient_amount":{{recipient_amount}}});
print_message({"debug":{{recipient_amount}}});

// Find recipient and construct operations
sender_amount = 0 - {{recipient_amount}};
Expand All @@ -63,6 +43,8 @@ transfer(10){
"create_limit": 100,
"create_probability": 50
});
print_message({"debug2":{{recipient_amount}}});
print_message({"recipient":{{recipient}}});
transfer.confirmation_depth = "1";
transfer.operations = [
{
Expand All @@ -87,47 +69,3 @@ transfer(10){
];
}
}

return_funds(10){
transfer{
transfer.network = set_variable({"network":"kava-localnet", "blockchain":"Kava"});
currency = {"symbol":"KAVA", "decimals":6};
max_fee = "1000";
sender = find_balance({
"minimum_balance":{
"value": {{max_fee}},
"currency": {{currency}}
}
});

// Set the recipient_amount as some sender.balance-max_fee
available_amount = {{sender.balance.value}} - {{max_fee}};
print_message({"available_amount":{{available_amount}}});
sender_amount = 0 - {{available_amount}};

// Provide a static address as the recipient and construct operations
faucet = {"address":"kava1vlpsrmdyuywvaqrv7rx6xga224sqfwz3fyfhwq"};
transfer.confirmation_depth = "1";
transfer.operations = [
{
"operation_identifier":{"index":0},
"type":"transfer",
"account":{{sender.account_identifier}},
"amount":{
"value":{{sender_amount}},
"currency":{{currency}}
}
},
{
"operation_identifier":{"index":1},
"related_operations":[{"index":0}],
"type":"transfer",
"account":{{faucet}},
"amount":{
"value":{{available_amount}},
"currency":{{currency}}
}
}
];
}
}
5 changes: 3 additions & 2 deletions rosetta-cli-conf/kava-localnet/kava.ros
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ transfer(10){

// Set the recipient_amount as some value <= sender.balance-max_fee
max_fee = "1000";
available_amount = {{sender.balance.value}} - {{max_fee}};
recipient_amount = random_number({"minimum": "1", "maximum": {{available_amount}}});
recipient_amount = "1001";
print_message({"recipient_amount":{{recipient_amount}}});

// Find recipient and construct operations
Expand Down Expand Up @@ -100,6 +99,8 @@ return_funds(10){
}
});

print_message({"sender":{{sender}}});

// Set the recipient_amount as some sender.balance-max_fee
available_amount = {{sender.balance.value}} - {{max_fee}};
print_message({"available_amount":{{available_amount}}});
Expand Down
3 changes: 3 additions & 0 deletions rosetta-cli-conf/kava-testnet-ci/kava.ros
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ transfer(1){
max_fee = "1000";
recipient_amount = "1001";
print_message({"recipient_amount":{{recipient_amount}}});
print_message({"debug":{{recipient_amount}}});

// Find recipient and construct operations
sender_amount = 0 - {{recipient_amount}};
Expand All @@ -40,6 +41,8 @@ transfer(1){
"create_limit": 100,
"create_probability": 50
});
print_message({"debug2":{{recipient_amount}}});
print_message({"recipient":{{recipient}}});
transfer.confirmation_depth = "1";
transfer.operations = [
{
Expand Down

0 comments on commit 6a381fb

Please sign in to comment.