Skip to content

Commit

Permalink
Merge pull request #277 from oasisprotocol/andrew7234/account-activity
Browse files Browse the repository at this point in the history
Add account related txs and events
  • Loading branch information
Andrew7234 authored Jan 17, 2023
2 parents e25d6a3 + 7e2af40 commit cca9868
Show file tree
Hide file tree
Showing 14 changed files with 445 additions and 237 deletions.
121 changes: 0 additions & 121 deletions analyzer/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,127 +81,6 @@ type RoundRange struct {
To uint64
}

// Backend is a consensus backend.
type Backend uint

const (
// BackendStaking is the consensus staking backend.
BackendStaking Backend = iota
// BackendRegistry is the consensus staking backend.
BackendRegistry
// BackendRoothash is the consensus staking backend.
BackendRoothash
// BackendGovernance is the consensus staking backend.
BackendGovernance
// BackendUnknown is an unknown staking backend.
BackendUnknown = 255
)

// String returns the string representation of a Backend.
func (b *Backend) String() string {
switch *b {
case BackendStaking:
return "staking"
case BackendRegistry:
return "registry"
case BackendRoothash:
return "roothash"
case BackendGovernance:
return "governance"
default:
//nolint:goconst
return "unknown"
}
}

// Event is a an event emitted by the consensus layer.
type Event uint

const (
// EventStakingTransfer is a transfer event.
EventStakingTransfer Event = iota
// EventStakingBurn is a burn event.
EventStakingBurn
// EventStakingAddEscrow is a add escrow event.
EventStakingAddEscrow
// EventStakingTakeEscrow is a take escrow event.
EventStakingTakeEscrow
// EventStakingDebondingStart is a debonding start event.
EventStakingDebondingStart
// EventStakingReclaimEscrow is a reclaim escrow event.
EventStakingReclaimEscrow
// EventStakingAllowanceChange is an allowance change event.
EventStakingAllowanceChange
// EventRegistryRuntime is a runtime registration event.
EventRegistryRuntime
// EventRegistryEntity is an entity registration event.
EventRegistryEntity
// EventRegistryNode is a node registration event.
EventRegistryNode
// EventRegistryNodeUnfrozen is a node unfrozen event.
EventRegistryNodeUnfrozen
// EventRoothashExecutorCommitted is an executor committed event.
EventRoothashExecutorCommitted
// EventRoothashExecutionDiscrepancyDetected is a runtime discrepancy detected event.
EventRoothashExecutionDiscrepancyDetected
// EventRoothashFinalizedEvent is a roothash finalization event.
EventRoothashFinalized
// EventGovernanceProposalSubmitted is a proposal submission event.
EventGovernanceProposalSubmitted
// EventGovernanceProposalExecuted is a proposal execution event.
EventGovernanceProposalExecuted
// EventGovernanceProposalFinalized is a proposal finalization event.
EventGovernanceProposalFinalized
// EventGovernanceVote is a proposal vote event.
EventGovernanceVote
// EventUnknown is an unknown event type.
EventUnknown = 255
)

// String returns the string representation of an Event.
func (e *Event) String() string {
switch *e {
case EventStakingTransfer:
return "staking.transfer"
case EventStakingBurn:
return "staking.burn"
case EventStakingAddEscrow:
return "staking.escrow.add"
case EventStakingTakeEscrow:
return "staking.escrow.take"
case EventStakingDebondingStart:
return "staking.escrow.debonding_start"
case EventStakingReclaimEscrow:
return "staking.escrow.reclaim"
case EventStakingAllowanceChange:
return "staking.allowance_change"
case EventRegistryRuntime:
return "registry.runtime"
case EventRegistryEntity:
return "registry.entity"
case EventRegistryNode:
return "registry.node"
case EventRegistryNodeUnfrozen:
return "registry.node_unfrozen"
case EventRoothashExecutorCommitted:
return "roothash.executor_committed"
case EventRoothashExecutionDiscrepancyDetected:
return "roothash.execution_discrepancy_detected"
case EventRoothashFinalized:
return "roothash.finalized"
case EventGovernanceProposalSubmitted:
return "governance.proposal_submitted"
case EventGovernanceProposalExecuted:
return "governance.proposal_executed"
case EventGovernanceProposalFinalized:
return "governance.proposal_finalized"
case EventGovernanceVote:
return "governance.vote"
default:
return "unknown"
}
}

// ChainID is the ID of a chain.
type ChainID string

Expand Down
Loading

0 comments on commit cca9868

Please sign in to comment.