Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/mamoru 35 update fork #7

Merged
merged 450 commits into from
Oct 3, 2022
Merged
Changes from 1 commit
Commits
Show all changes
450 commits
Select commit Hold shift + click to select a range
e0f7fc9
[rosetta/cli] Add headroom to max gas calculation
gregnazario Sep 20, 2022
6d602aa
[cli] Bump to verison 0.3.5
gregnazario Sep 20, 2022
29713ab
[aptos-cli] Improve price estimation confirmation message
gregnazario Sep 21, 2022
1279411
Update prover-test.yaml (#4386)
junkil-park Sep 21, 2022
06abbab
[forge] Implement ability to run multiple tests
perryjrandall Sep 13, 2022
ea67037
fix: fix typo coin_client.ts parameter description
mincheolog Sep 21, 2022
18bbf8f
[aptos-crypto] Remove expect from signing message
gregnazario Sep 20, 2022
cfec0be
[aptos-crypto] Disable broken derive test
gregnazario Sep 20, 2022
32105ad
[crypto] Remove Result output of sign arbitrary message
gregnazario Sep 21, 2022
5869b6f
[consensus] Propagate results for Vote::new()
gregnazario Sep 21, 2022
7257c1a
[crypto-derive] Fix derive and test for Result in sign function
gregnazario Sep 21, 2022
2882791
fix: add extra gas paramters to TokenClient apis
jjleng Sep 21, 2022
9a5f32f
fix: clean up the TS doc - in progress
jjleng Sep 21, 2022
8a0c418
fix: show detailed error message for txn submission failures
jjleng Sep 21, 2022
11ac649
refactor: consolidate some hard coded paramters
jjleng Sep 21, 2022
2cf202c
feat: interface to estimate max gas amount
jjleng Sep 21, 2022
2dc4ce5
[Docs] Cleaning up tutorial docs.
Sep 21, 2022
abc87db
[Docs] Minor cleanup
Sep 21, 2022
0615041
[Docs] More cleanup
Sep 21, 2022
ede9355
[Docs] Fixing code snippet style.
Sep 21, 2022
25b3b18
[Docs] Minor edit.
Sep 21, 2022
c29945c
[tf] update utility node requirement (#4404)
rustielin Sep 21, 2022
b2ec738
[Docs] Demoting the CLI install by source in the docs.
Sep 21, 2022
bb2ab09
Update ruby deps. (#4342)
zacharydenton Sep 21, 2022
4e89500
Revert "[forge] Implement ability to run multiple tests" (#4430)
rustielin Sep 21, 2022
f5547b7
fix(ts-sdk): fix the failing example tests
jjleng Sep 21, 2022
b55be50
[aptos-logger] Add key to error message telling that serialization fa…
gregnazario Sep 21, 2022
d9fd3a5
[api] Cache the gas schedule
gregnazario Sep 19, 2022
89f24ac
[api] Limit transactions out of block APIs
gregnazario Sep 20, 2022
3c09bc9
[rosetta] Paginate transactions for blocks
gregnazario Sep 20, 2022
fba0945
[api] Update spec for new block API description
gregnazario Sep 21, 2022
14e1846
update explorer domain (#4424)
0xZihan Sep 21, 2022
fc32a49
[dashboards] sync grafana dashboards (#4427)
github-actions[bot] Sep 21, 2022
2d790fa
Change https to http for localhost url
jsbarrett Sep 15, 2022
2fdc842
[Consensus] Add metrics for pending blocks per stage (#4357)
sitalkedia Sep 21, 2022
def8dfb
[consensus] fix log spew from u128 in structured logs
igor-aptos Sep 21, 2022
4c42944
Update privacy policy (#4432)
hariria Sep 22, 2022
991ea85
[storage] small fixes (#4419)
msmouse Sep 22, 2022
8cf06cf
[Token] Add get max property version (#4436)
CapCap Sep 22, 2022
616d3fe
[cicd] smoke tests: build with all features
bchocho Sep 21, 2022
8b2758e
[Docs] Enhancing docs stuff.
Sep 22, 2022
2dfa754
[aptos-node] Tune local testnet parameters
gregnazario Sep 21, 2022
1161597
[forge][flaky] Fix consensus_stress_test (#4409)
igor-aptos Sep 22, 2022
e505762
[smoke tests] add a retry for initializing swarm, apply to 2 tests (#…
bchocho Sep 22, 2022
ccd2256
[aptos-rosetta] Add set voter operation
gregnazario Sep 21, 2022
40d211d
[aptos-rosetta] Parse set voter from transaction payloads
gregnazario Sep 21, 2022
784fbd9
[smoke-test] Add Rosetta hash uniqueness checks
gregnazario Sep 21, 2022
2cb62ac
[aptos-rosetta] Fix failed set operator and set voter outputs
gregnazario Sep 21, 2022
221bc7b
Limit the upper bound of `rewards_rate` (#4185)
junkil-park Sep 22, 2022
cf0cb38
[telemetry-service] remote log level configuration (#4367)
ibalajiarun Sep 22, 2022
9bd5a1c
[consensus] surface insert vote error
zekun000 Sep 15, 2022
5f7c7d1
[consensus] better logging
zekun000 Sep 19, 2022
45998a3
[consensus] add missing checks
zekun000 Sep 20, 2022
4a9d3d9
[node-resource-metrics][bugfix] allow disk metrics for nvme disks (#4…
ibalajiarun Sep 22, 2022
ef1e6dd
[Docs] Editorial cleanup.
Sep 22, 2022
1f8c5c3
Add a staking proxy contract
movekevin Sep 21, 2022
02e5893
remove aptos_token::token::initialize_token (#4385)
jquesnelle Sep 22, 2022
50bbf4d
[Docs] Merging dev resources doc into getting started doc.
Sep 22, 2022
3910eae
[backup] restore coordinator: fix snapshot selection
msmouse Sep 22, 2022
830f170
[aptos-cli] Remove default max gas, and rely on estimation
gregnazario Sep 22, 2022
322147f
[aptos-cli] Handle errors from simulation in the API
gregnazario Sep 22, 2022
4d388c4
[rest-client] Add ability to describe execution status with rest client
gregnazario Sep 22, 2022
0bdf61b
[backup] fix local_folder.sample.yaml
msmouse Sep 20, 2022
a74e8f1
[consensus] fix edge case of block retrieval
zekun000 Sep 22, 2022
a321cf3
[aptos-rosetta] Put decoded full transaction into parse transaction
gregnazario Sep 22, 2022
a5ab247
trivial: typo fix: the the
msmouse Sep 22, 2022
3150203
fix typo
msmouse Sep 22, 2022
b75b22d
trivial: move a log line
msmouse Sep 22, 2022
bea2fce
[storage] get_rightmost_leaf take a version (#4123)
lightmark Sep 23, 2022
3219e72
[aptos-move] Allow updating operator without changing commission (#4465)
gregnazario Sep 23, 2022
bc14ce7
add current token datas (#4379)
bowenyang007 Sep 23, 2022
ed79bcc
[framework] Move `features.move` into stdlib so it can be used from e…
wrwg Sep 23, 2022
7058779
Proved the `storage_gas` module (#4452)
junkil-park Sep 23, 2022
727f8b4
[aptos-rosetta] Keep checking that the API isn't up forever
gregnazario Sep 22, 2022
a56e419
[aptos-cli] Allow compiling scripts and proposals with local framework
gregnazario Sep 21, 2022
51455ed
[aptos-cli] Add a command to generate writeset for fire events
runtian-zhou Sep 9, 2022
374e2b6
[Genesis] Always create staking contracts in mainnet genesis (#4466)
movekevin Sep 23, 2022
a518889
[Docs][Upgradability] Update docs (#4454)
movekevin Sep 23, 2022
f9c52c8
Fix broken compile call in CLI
movekevin Sep 23, 2022
a5ac706
[docs] Add information about retrieving balance changes from events
gregnazario Sep 22, 2022
14b69bd
[gas] add script to generate gas schedule update proposal (#4471)
vgao1996 Sep 23, 2022
f12c362
[cached-packages] Update framework builder
gregnazario Sep 23, 2022
bc50b5a
[aptos-cli] Move to using account transfer over coin transfer
gregnazario Sep 23, 2022
f2dccd6
[aptos-cli] Change `coin` to `octa`
gregnazario Sep 22, 2022
5836d68
[aptos-rosetta] fix broken test
gregnazario Sep 23, 2022
982f560
[aptos-cli] Add test for checking parameters of generate-admin-write-set
gregnazario Sep 23, 2022
703a1d4
[framework] prepare for testnet upgrade
davidiw Sep 23, 2022
e8db833
[node-resource-metrics] Fix double prometheus register
gregnazario Sep 23, 2022
27cff42
revert Validate Move String transaction arguments (#4483)
zekun000 Sep 23, 2022
68b939f
[telemetry-service] security audit fixes and related refactorings (#4…
ibalajiarun Sep 23, 2022
5aef987
[forge] prometheus auth option and remove opensearch support (#4442)
rustielin Sep 23, 2022
a839e3b
[mempool] possibly fix fn_to_val_test (#4468)
bchocho Sep 23, 2022
b17e8d9
[Docs] New gas doc and a minor nit in sys integ doc.
Sep 22, 2022
fab74c6
[Docs] Fixing the API link.
Sep 22, 2022
a7aa701
[Docs] Section header change.
Sep 22, 2022
12c1f21
[Docs] Fixing broken link.
Sep 23, 2022
4f385b3
[Docs] Working in review comments.
Sep 23, 2022
e24996c
[dashboards] sync grafana dashboards (#4439)
github-actions[bot] Sep 23, 2022
ab3ba15
[storage-audit-fix] dedup some constants (#4423)
lightmark Sep 23, 2022
3336025
[certik] fix storage comments (#4477)
lightmark Sep 23, 2022
89a9012
[Rust SDK] Increase `gas_unit_price` and fund balance in `transfer-co…
stevenatcrypto Sep 23, 2022
cf28ebb
[txn-emitter] Fix ConstTps txn-emitter to wait enough for transaction…
igor-aptos Sep 23, 2022
f67152b
[aptos-move] Update move dependency
gregnazario Sep 23, 2022
ad8b915
[mempool] Add counter for created block size in txn count and byte si…
igor-aptos Sep 23, 2022
a211126
[api] Fix gas cache on price estimation
gregnazario Sep 23, 2022
22a263c
[GHA] add branch for docker (#4501)
sherry-x Sep 23, 2022
827e1c6
[Genesis][Vesting] Add a convenient update_operator feature with same…
movekevin Sep 23, 2022
a4e55c0
[smoke tests] local swarm build retries 3 times (#4461)
bchocho Sep 24, 2022
e4dd589
[configs] Update block size (txns/bytes) and make configs consistent …
igor-aptos Sep 24, 2022
de18393
[Aptos Framework][Voting][Audit issue] Do not allow changing votes af…
movekevin Sep 24, 2022
08cc1a0
[aptos-faucet] Log x-forwarded-for header
gregnazario Sep 24, 2022
b450444
[move-examples] add a script that makes minting operations atomic
davidiw Sep 24, 2022
d4b50a2
[cli] add support for txn params for script functions
davidiw Sep 24, 2022
da475e9
[cli] add support for (already) compiled scripts
davidiw Sep 24, 2022
649fb13
[faucet] move to txn script for perf
davidiw Sep 24, 2022
6956fd5
Fix type on line 133 (#4488)
Shih-Yu Sep 24, 2022
145428f
[Token] add burn control flag (#4358)
areshand Sep 24, 2022
14adf98
[framework] remove initializer since it isn't called
davidiw Sep 23, 2022
c70fa9a
[genesis] remove legacy gas schedule and update testnet.mrb
davidiw Sep 23, 2022
852deea
[e2e-move-tests] integration -> unit for faster execution
davidiw Sep 24, 2022
a7ea562
[Token] Fix two fields in the token trasnfer event
areshand Sep 23, 2022
cd8c0f1
[TOK] Add helpers to token (#4516)
CapCap Sep 25, 2022
f7620e4
fix(aptos-stdlib): typo
0xbe1 Sep 23, 2022
ca3d6e9
[move-e2e] remove version testing since it wasn't actually testing ou…
davidiw Sep 24, 2022
4e1c9b4
[move-e2e] remove legacy testing harnesses
davidiw Sep 24, 2022
b72f5ce
[CP] remove community platform
CapCap Sep 25, 2022
5314b72
remove build
CapCap Sep 25, 2022
73c1c9e
observability: structured logging for faucet requests (#4529)
geekflyer Sep 25, 2022
b433b96
[dev_setup] remove codegen as we don't use it anymore
davidiw Sep 25, 2022
21991ff
[MOVE] Format all source files to be consistent (#4526)
CapCap Sep 25, 2022
617a3c8
Remove cli config from repo
jjleng Sep 23, 2022
8584224
[Docs] Updating the doc to be consistent with the white paper termino…
Sep 23, 2022
a82d1b2
[Tests] Add a test for init_module when republishing package (#4487)
movekevin Sep 25, 2022
d287fe1
Update first-dapp.md
davidiw Sep 25, 2022
ff44785
[Staking][Minor fix] Enforce max validator set size after adding the …
movekevin Sep 25, 2022
7031365
[FW] Add upsert to TableWithLength (#4535)
CapCap Sep 26, 2022
25e1caa
[Voting][Minor fix] Validate that minimum vote threshold <= early res…
movekevin Sep 26, 2022
50585fe
[aptos-rosetta] Rename operator field to new_operator and voter
gregnazario Sep 22, 2022
c26fb7c
[aptos-node] Minimize overhead of local test mode
gregnazario Sep 24, 2022
b9c9be4
[rosetta] Add subaccounts for staking
gregnazario Sep 25, 2022
29c7235
[rosetta] Update types for staking
gregnazario Sep 25, 2022
6193197
[rosetta] Remove AccountIdentifier try into AccountAddress
gregnazario Sep 25, 2022
dab2288
[rosetta] Move to using AccountIdentfier as an input to operations
gregnazario Sep 25, 2022
b445ee6
[rosetta] Add staking balances on account balance
gregnazario Sep 25, 2022
24286b0
[rosetta] Remove unnecessary log line
gregnazario Sep 25, 2022
ba45d4c
[rosetta] Use stake amounts rather than principal for stake pool bala…
gregnazario Sep 25, 2022
57452f9
[rosetta] Remove stake pool parsing
gregnazario Sep 25, 2022
bd139b1
[rosetta] Remove dead code, add staking balance changes in block parsing
gregnazario Sep 25, 2022
0081851
[rosetta] Add original operator to voter and operator operations
gregnazario Sep 25, 2022
79ea949
[rosetta] Add StakeReward operation to differentiate between stake re…
gregnazario Sep 25, 2022
8bd69f5
[rosetta] Add SetVoter support for get block
gregnazario Sep 25, 2022
7ff546c
[rosetta] Add set operator and set voter support
gregnazario Sep 25, 2022
d864329
[rosetta] Remove unknown account identifier
gregnazario Sep 25, 2022
f59e423
[rosetta] Fix tests to support new voter and operator operations
gregnazario Sep 25, 2022
81a6a85
[rosetta] Load owner address mapping at startup
gregnazario Sep 26, 2022
f1d64a5
docs: add multi-signer account case to building-your-on-wallet
scottphc Sep 21, 2022
246bc7a
docs: update properties to optioanl
scottphc Sep 21, 2022
70aae96
docs: update publicKey type and signature type
scottphc Sep 22, 2022
792f881
[Tests only][aptos_framework] chain_id: initialize for test (to speci…
linnefromice Sep 26, 2022
2f9ff45
[dashboards] sync grafana dashboards (#4499)
github-actions[bot] Sep 26, 2022
110199b
[Tests only] Add an e2e test for staking_contract flow (#4537)
movekevin Sep 26, 2022
60b1175
[mempool] fix GC'd txn metric (#4502)
bchocho Sep 26, 2022
4bd84f9
[Docs] Adding Windows platform option and enhancing the doc.
Sep 26, 2022
484e59d
[storage] update readme
msmouse Sep 26, 2022
c3af89c
[storage] update alerts
msmouse Sep 25, 2022
2a87c69
[forge] Fix continuous forge tests by updating configurations (#4515)
igor-aptos Sep 26, 2022
f979bfd
[backup] fix still flaky smoke test test_db_restore
msmouse Sep 25, 2022
b30f799
[Node CLI] Add a command that returns the stake pool address (#4503)
movekevin Sep 26, 2022
b2e31a6
[gha] only copy release images to dockerhub (#4509)
rustielin Sep 26, 2022
fd6807b
[backup] fix that get_transaction_iter() on non-existent version can …
msmouse Sep 25, 2022
ce633be
execution readme update
msmouse Sep 26, 2022
2713c31
[aptos-cli] Support vector<vector<u8>> for run function and script
gregnazario Sep 26, 2022
c167d56
execution readme update
msmouse Sep 26, 2022
7e00d2c
[Community] Add coin::unfreeze_coin_store function to coin module (#4…
Sep 27, 2022
d4fb91a
[sdk-builder] Ensure string encoding is named a separate function
gregnazario Sep 26, 2022
2cc0cf5
[txn-emitter] Fix underflow when first request fails (#4567)
igor-aptos Sep 27, 2022
743b90e
Update whats-new-in-docs.md
clay-aptos Sep 26, 2022
9ac3e62
[dev setup] Ensure unzip installed before protoc
gregnazario Sep 26, 2022
b2a8d32
[rosetta] Fix Set Voter events parsing
gregnazario Sep 27, 2022
d9a2c47
[rosetta] Make operator optional to setvoter setoperator
gregnazario Sep 27, 2022
83ea742
[move] Update to latest commit of `aptos` release branch in Move repo
wrwg Sep 27, 2022
36914db
[gha] Conditionally run pull request and pull request target based on…
perryjrandall Sep 26, 2022
91d81a7
[tf/helm] delete old indexer deployment configs (#4565)
rustielin Sep 27, 2022
df56528
[compression] limit (de)compression, to network application limit siz…
bchocho Sep 27, 2022
9b1fe7a
[CLI] Make GetStakePool CLI easier to use and add CreateStakingContra…
movekevin Sep 27, 2022
bfd78d2
[forge] Implement ability to run multiple tests again
perryjrandall Sep 26, 2022
633d303
Fixing broken link.
Sep 27, 2022
d5844d4
[Docs] Cleanup of events and proof docs.
Sep 24, 2022
caa7228
[Docs] Merging Proof doc into txns and states doc.
Sep 26, 2022
e7c096e
[Docs] Updating.
Sep 26, 2022
2ab47c4
[Docs] Adding redirect.
Sep 26, 2022
397498f
[Docs] Fixing broken links for the deleted doc.
Sep 26, 2022
4bf3978
[Docs] Discarding basics events doc from this pr.
Sep 26, 2022
a2e4104
[Docs] Working in comments by Greg.
Sep 27, 2022
65a10f2
As smoke test swarm init has stabilized, reenable some more tests (#4…
bchocho Sep 27, 2022
19078c0
[forge] better sts errors (#4582)
rustielin Sep 27, 2022
94ddd4b
[Genesis][Tooling] Allow skipping operator config file if validator i…
movekevin Sep 27, 2022
cc9a3a0
[gha] test haproxy in forge continuously
rustielin Sep 27, 2022
6f306e1
Fix misspellings throughout docs
Sep 27, 2022
c88f7f3
Lowercase blockchain
clay-aptos Sep 27, 2022
7eee93c
[storage] delete range_delete
msmouse Sep 27, 2022
2a2838a
[forge] Fix step summary formatting
perryjrandall Sep 21, 2022
e70b50d
[gha] Run forge continuous on PR only when workflow is modified
perryjrandall Sep 28, 2022
e3287b9
[forge] Make multi runner use markdown
perryjrandall Sep 28, 2022
e7bc590
[forge] set default gas price
rustielin Sep 27, 2022
139cbfc
[genesis] make genesis.sh backwards compat
rustielin Sep 28, 2022
b27e0c8
fix: fix the interface doc about getting txns for by account
jjleng Sep 26, 2022
b5542bc
feat(ts-sdk): expose nodeUrl
jjleng Sep 26, 2022
034960e
[aptos-rosetta] Remove stake balance changes and use switch operator …
gregnazario Sep 27, 2022
50557e8
[rosetta] Put balance in set operator operation
gregnazario Sep 27, 2022
8a91ddd
[rosetta] Add operators to balance stake lookups
gregnazario Sep 27, 2022
ea69a35
[rosetta] Add initialize stake pool as a construction API
gregnazario Sep 27, 2022
600261a
[rosetta] Add CLI support for create stake pool
gregnazario Sep 27, 2022
8f4d499
[rosetta] fix tests for staking
gregnazario Sep 28, 2022
6ac18b8
[rosetta] Fix parsing of create stake pool transactions
gregnazario Sep 28, 2022
695dc4c
[rosetta] Use state changes to keep track of operator changes
gregnazario Sep 28, 2022
7b34e28
[Api] Expose Move error details for simulation endpoints
jjleng Sep 26, 2022
0a0599a
[telemetry] codeowner file
ibalajiarun Sep 27, 2022
f87b98d
[forge] fix grafana namespace (#4602)
rustielin Sep 28, 2022
74b8581
[HApropxy] new haproxy config and resources
Markuze Sep 22, 2022
300206b
[Docker] Adding HAProxy to docker compose
Markuze Sep 22, 2022
71264a5
[tokio-console] Configuring tokio-console default port
Markuze Sep 27, 2022
7d825e4
[aptos-cli] Bump to version 0.3.6
gregnazario Sep 28, 2022
1aad991
[storage] larger default state prune window
msmouse Sep 28, 2022
98f947e
refactor: add "strict" to SDK tsconfig
jjleng Sep 23, 2022
90ae12a
[helm][aptos-node] override NodeConfig with deep merge (#4546)
rustielin Sep 28, 2022
02e41b3
add indexer to cli (#4586)
bowenyang007 Sep 28, 2022
c6f6ae4
Node docs (#4572)
Sep 28, 2022
ba41989
[SDK][API] Remove event key endpoint / client code (#4338)
banool Sep 28, 2022
5523c03
[backup] tf: add back backup intervals
msmouse Sep 28, 2022
b80a746
[consensus] support a recovery mode if consensusdb is gone
zekun000 Sep 23, 2022
fb46119
[forge][telemetry] enable node telemetry in forge (#4490)
ibalajiarun Sep 29, 2022
aae4ea0
[storage] rename target_snapshot_size (#4615)
lightmark Sep 29, 2022
6761db2
[txn-emitter] Fix computation for needed coin balance (#4614)
igor-aptos Sep 29, 2022
aec93c3
[executor] fix integration test helper
msmouse Sep 28, 2022
c2ab1a7
enable backup-cli unit tests in ci
msmouse Sep 28, 2022
e6210ca
[gha] Make forge namespace optional
perryjrandall Sep 28, 2022
4d520ba
[network] limit the max fragments in stream message
zekun000 Sep 27, 2022
998f118
[consensus] limit the payload size and remove unused quorum store var…
zekun000 Sep 27, 2022
a63db93
[doc] update doc to remove test mode (#4626)
sherry-x Sep 29, 2022
8ad5837
[gha] Enable release on PR, enable HAProxy on release test
perryjrandall Sep 28, 2022
2dc1a9b
[Aptos Stdlib] Make scaling factor actually useful in pool_u64
movekevin Sep 26, 2022
afa8e73
[API Client] Fix wait_for_transaction to wait for expiry and return b…
igor-aptos Sep 29, 2022
0bea75d
Revert "[HApropxy] new haproxy config and resources"
perryjrandall Sep 30, 2022
61082d1
Merge remote-tracking branch 'aptos/devnet' into feat/update-devnet-c…
sokyrko Sep 30, 2022
1ef8f10
Adapt new changes
sokyrko Sep 30, 2022
ce094fe
Update goldenfiles
sokyrko Oct 3, 2022
4a55b4f
Exclude `forge` tests
sokyrko Oct 3, 2022
c49716d
Update move repository ref
sokyrko Oct 3, 2022
6003b8b
Update move repository ref
sokyrko Oct 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[rosetta] Add StakeReward operation to differentiate between stake re…
…wards
  • Loading branch information
gregnazario committed Sep 26, 2022
commit 79ea949ea7e44279da6e7dd702f93580147a6e92
31 changes: 19 additions & 12 deletions crates/aptos-rosetta/src/types/misc.rs
Original file line number Diff line number Diff line change
@@ -82,6 +82,7 @@ pub enum OperationType {
// Withdraw must come before deposit
Withdraw,
Deposit,
StakingReward,
SetOperator,
SetVoter,
// Fee must always be last for ordering
@@ -93,17 +94,20 @@ impl OperationType {
const DEPOSIT: &'static str = "deposit";
const WITHDRAW: &'static str = "withdraw";
const FEE: &'static str = "fee";
const STAKING_REWARD: &'static str = "staking_reward";
const SET_OPERATOR: &'static str = "set_operator";
const SET_VOTER: &'static str = "set_voter";

pub fn all() -> Vec<OperationType> {
use OperationType::*;
vec![
OperationType::CreateAccount,
OperationType::Withdraw,
OperationType::Deposit,
OperationType::Fee,
OperationType::SetOperator,
OperationType::SetVoter,
CreateAccount,
Withdraw,
Deposit,
Fee,
SetOperator,
SetVoter,
StakingReward,
]
}
}
@@ -117,6 +121,7 @@ impl FromStr for OperationType {
Self::DEPOSIT => Ok(OperationType::Deposit),
Self::WITHDRAW => Ok(OperationType::Withdraw),
Self::FEE => Ok(OperationType::Fee),
Self::STAKING_REWARD => Ok(OperationType::StakingReward),
Self::SET_OPERATOR => Ok(OperationType::SetOperator),
Self::SET_VOTER => Ok(OperationType::SetVoter),
_ => Err(ApiError::DeserializationFailed(Some(format!(
@@ -129,13 +134,15 @@ impl FromStr for OperationType {

impl Display for OperationType {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
use OperationType::*;
f.write_str(match self {
OperationType::CreateAccount => Self::CREATE_ACCOUNT,
OperationType::Deposit => Self::DEPOSIT,
OperationType::Withdraw => Self::WITHDRAW,
OperationType::SetOperator => Self::SET_OPERATOR,
OperationType::SetVoter => Self::SET_VOTER,
OperationType::Fee => Self::FEE,
CreateAccount => Self::CREATE_ACCOUNT,
Deposit => Self::DEPOSIT,
Withdraw => Self::WITHDRAW,
StakingReward => Self::STAKING_REWARD,
SetOperator => Self::SET_OPERATOR,
SetVoter => Self::SET_VOTER,
Fee => Self::FEE,
})
}
}
24 changes: 22 additions & 2 deletions crates/aptos-rosetta/src/types/objects.rs
Original file line number Diff line number Diff line change
@@ -209,6 +209,26 @@ impl Operation {
)
}

pub fn staking_reward(
operation_index: u64,
status: Option<OperationStatusType>,
account: AccountIdentifier,
currency: Currency,
amount: u64,
) -> Operation {
Operation::new(
OperationType::StakingReward,
operation_index,
status,
account,
Some(Amount {
value: amount.to_string(),
currency,
}),
None,
)
}

pub fn deposit(
operation_index: u64,
status: Option<OperationStatusType>,
@@ -935,15 +955,15 @@ fn parse_stake_pool_resource_changes(

// For every distribute rewards events, add to the staking pools
for event in distribute_rewards_events {
operations.push(Operation::deposit(
operations.push(Operation::staking_reward(
operation_index,
Some(OperationStatusType::Success),
total_stake_account.clone(),
native_coin(),
event.rewards_amount,
));
operation_index += 1;
operations.push(Operation::deposit(
operations.push(Operation::staking_reward(
operation_index,
Some(OperationStatusType::Success),
operator_stake_account.clone(),
39 changes: 39 additions & 0 deletions testsuite/smoke-test/src/rosetta.rs
Original file line number Diff line number Diff line change
@@ -1245,6 +1245,45 @@ async fn parse_operations(
);
}
}
OperationType::StakingReward => {
let account = operation
.account
.as_ref()
.expect("There should be an account in a stake reward operation")
.account_address()
.expect("Account address should be parsable");

if actual_successful {
assert_eq!(OperationStatusType::Success, status);
let account_balances = balances.entry(account).or_insert_with(|| {
let mut map = BTreeMap::new();
map.insert(block_height, 0);
map
});
let (_, latest_balance) = account_balances.iter().last().unwrap();
let amount = operation
.amount
.as_ref()
.expect("Should have an amount in a stake reward operation");
assert_eq!(
amount.currency,
native_coin(),
"Balance should be the native coin"
);
let delta =
u64::parse(&amount.value).expect("Should be able to parse amount value");

// Add with panic on overflow in case of too high of a balance
let new_balance = *latest_balance + delta as i128;
account_balances.insert(block_height, new_balance);
} else {
assert_eq!(
OperationStatusType::Failure,
status,
"Failed transaction should have failed stake reward operation"
);
}
}
OperationType::SetOperator => {
if actual_successful {
assert_eq!(