The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/wiki/transaction.go

81 lines
2.6 KiB

8 months ago
package wiki
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
import (
"context"
"github.com/ethereum/go-ethereum/common"
8 months ago
"github.com/woop-chain/woop/core"
"github.com/woop-chain/woop/core/rawdb"
"github.com/woop-chain/woop/core/types"
"github.com/woop-chain/woop/eth/rpc"
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
)
// SendTx ...
8 months ago
func (wiki *Woop) SendTx(ctx context.Context, signedTx *types.Transaction) error {
tx, _, _, _ := rawdb.ReadTransaction(wiki.chainDb, signedTx.Hash())
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
if tx == nil {
8 months ago
return wiki.NodeAPI.AddPendingTransaction(signedTx)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
}
return ErrFinalizedTransaction
}
// ResendCx retrieve blockHash from txID and add blockHash to CxPool for resending
// Note that cross shard txn is only for regular txns, not for staking txns, so the input txn hash
// is expected to be regular txn hash
8 months ago
func (wiki *Woop) ResendCx(ctx context.Context, txID common.Hash) (uint64, bool) {
blockHash, blockNum, index := wiki.BlockChain.ReadTxLookupEntry(txID)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
if blockHash == (common.Hash{}) {
return 0, false
}
8 months ago
blk := wiki.BlockChain.GetBlockByHash(blockHash)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
if blk == nil {
return 0, false
}
txs := blk.Transactions()
// a valid index is from 0 to len-1
if int(index) > len(txs)-1 {
return 0, false
}
tx := txs[int(index)]
// check whether it is a valid cross shard tx
if tx.ShardID() == tx.ToShardID() || blk.Header().ShardID() != tx.ShardID() {
return 0, false
}
3 years ago
entry := core.CxEntry{BlockHash: blockHash, ToShardID: tx.ToShardID()}
8 months ago
success := wiki.CxPool.Add(entry)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
return blockNum, success
}
// GetReceipts ...
8 months ago
func (wiki *Woop) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
return wiki.BlockChain.GetReceiptsByHash(hash), nil
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
}
// GetTransactionsHistory returns list of transactions hashes of address.
8 months ago
func (wiki *Woop) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error) {
return wiki.NodeAPI.GetTransactionsHistory(address, txType, order)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
}
// GetAccountNonce returns the nonce value of the given address for the given block number
8 months ago
func (wiki *Woop) GetAccountNonce(
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
ctx context.Context, address common.Address, blockNum rpc.BlockNumber) (uint64, error) {
8 months ago
state, _, err := wiki.StateAndHeaderByNumber(ctx, blockNum)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
if state == nil || err != nil {
return 0, err
}
return state.GetNonce(address), state.Error()
}
// GetTransactionsCount returns the number of regular transactions of address.
8 months ago
func (wiki *Woop) GetTransactionsCount(address, txType string) (uint64, error) {
return wiki.NodeAPI.GetTransactionsCount(address, txType)
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
}
// GetCurrentTransactionErrorSink ..
8 months ago
func (wiki *Woop) GetCurrentTransactionErrorSink() types.TransactionErrorReports {
return wiki.NodeAPI.ReportPlainErrorSink()
Node API Refactor (Stage 2.1 of Node API Overhaul) (#3244) * Add latest dir removal for make clean Fix docker image in README Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Expose Harmony attributes & remove accessors * Add internals for APIBackend & Harmony fuse * Add skeleton for refactor of GetTotalStakingSnapshot Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Re-implement APIBacked methods in Harmony * Add 'FIXME:done' comments to indicate implemented methods, some were left out as they are simple accessors and will transition to using the exposed harmony attributes. * Split functions into standalone files for clarity. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Fix GetTotalStakingSnapshot in Harmony implementation Previous implementation used rps.LatestBlockNumber, which is a constant -1, thus, the cache was never used Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Move ErrFinalizedTransaction to hmy.go Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make PublicHarmonyAPI use Harmony instead of Backed Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicBlockChainAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make NewPublicTransactionPoolAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make DebugAPI use Harmony instead of Backend Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filers use Harmony instead of Backend * Fix unhandled errors Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Change NetVersion to ChainID Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Change API service declaration to use Harmony * Remove irrelevant TODOs Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [node] Refactor - Move harmony create to APIs fetch Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove api_backend.go & Backend * Update hmyapi net.go to return ChainID as Version * Remove unused err return on New Harmony obj Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Prettify var names, structure & comments Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Remove backend interface * Fix lint Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Remove exposure for eventMux and chainDb This is to satisfy existing interfaces, mainly the in filters. Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy + hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmy] Refactor - Apply changes from #3243 Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Make filters use Backend instead of hmy This is for testing from eth if we need it in the future Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu> * [hmyapi] Refactor - Fix imports Signed-off-by: Daniel Van Der Maden <dvandermaden0@berkeley.edu>
4 years ago
}