burrow event

Event

type Event struct {
	Header               *Header             `protobuf:"bytes,1,opt,name=Header,proto3" json:"Header,omitempty"`
	Input                *InputEvent         `protobuf:"bytes,2,opt,name=Input,proto3" json:"Input,omitempty"`
	Output               *OutputEvent        `protobuf:"bytes,3,opt,name=Output,proto3" json:"Output,omitempty"`
	Call                 *CallEvent          `protobuf:"bytes,4,opt,name=Call,proto3" json:"Call,omitempty"`
	Log                  *LogEvent           `protobuf:"bytes,5,opt,name=Log,proto3" json:"Log,omitempty"`
	GovernAccount        *GovernAccountEvent `protobuf:"bytes,6,opt,name=GovernAccount,proto3" json:"GovernAccount,omitempty"`
}

type InputEvent struct {
	Address              github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"`
}

type OutputEvent struct {
	Address              github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"`
}

header

type Header struct {
	// Transaction type
	TxType github_com_hyperledger_burrow_txs_payload.Type `protobuf:"varint,1,opt,name=TxType,proto3,casttype=github.com/hyperledger/burrow/txs/payload.Type" json:"TxType,omitempty"`
	// The hash of the transaction that caused this event to be generated
	TxHash github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,2,opt,name=TxHash,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"TxHash"`
	// The type of event
	EventType EventType `protobuf:"varint,3,opt,name=EventType,proto3,casttype=EventType" json:"EventType,omitempty"`
	// EventID published with event
	EventID string `protobuf:"bytes,4,opt,name=EventID,proto3" json:"EventID,omitempty"`
	// The block height at which this event was emitted
	Height uint64 `protobuf:"varint,5,opt,name=Height,proto3" json:"Height,omitempty"`
	// The index of this event relative to other events generated by the same transaction
	Index uint64 `protobuf:"varint,6,opt,name=Index,proto3" json:"Index,omitempty"`
	// If event is exception
	Exception            *errors.Exception `protobuf:"bytes,7,opt,name=Exception,proto3" json:"Exception,omitempty"`
}

event type

TypeBeginBlock ~ TypeEndBlock is used by stream event to mark the border of data stream. We will discuss it in burrow stream event

// Execution event types
const (
	TypeUnknown EventType = iota
	TypeCall
	TypeLog
	TypeAccountInput
	TypeAccountOutput
	TypeTxExecution
	TypeBlockExecution
	TypeGovernAccount
	TypeBeginBlock
	TypeBeginTx
	TypeEnvelope
	TypeEndTx
	TypeEndBlock
)
event id
func EventStringAccountInput(addr crypto.Address) string  { return fmt.Sprintf("Acc/%s/Input", addr) }
func EventStringAccountOutput(addr crypto.Address) string { return fmt.Sprintf("Acc/%s/Output", addr) }

func EventStringAccountCall(addr crypto.Address) string    { return fmt.Sprintf("Acc/%s/Call", addr) }
func EventStringLogEvent(addr crypto.Address) string       { return fmt.Sprintf("Log/%s", addr) }
func EventStringTxExecution(txHash []byte) string          { return fmt.Sprintf("Execution/Tx/%X", txHash) }
func EventStringGovernAccount(addr *crypto.Address) string { return fmt.Sprintf("Govern/Acc/%v", addr) }

call event

type CallEvent struct {
	CallType             CallType                                      `protobuf:"varint,5,opt,name=CallType,proto3,casttype=CallType" json:"CallType,omitempty"`
	CallData             *CallData                                     `protobuf:"bytes,1,opt,name=CallData,proto3" json:"CallData,omitempty"`
	Origin               github_com_hyperledger_burrow_crypto.Address  `protobuf:"bytes,2,opt,name=Origin,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Origin"`
	StackDepth           uint64                                        `protobuf:"varint,3,opt,name=StackDepth,proto3" json:"StackDepth,omitempty"`
	Return               github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,4,opt,name=Return,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"Return"`
}

type CallType uint32

const (
	CallTypeCall     = CallType(0x00)
	CallTypeCode     = CallType(0x01)
	CallTypeDelegate = CallType(0x02)
	CallTypeStatic   = CallType(0x03)
)

type CallData struct {
	Caller               github_com_hyperledger_burrow_crypto.Address  `protobuf:"bytes,1,opt,name=Caller,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Caller"`
	Callee               github_com_hyperledger_burrow_crypto.Address  `protobuf:"bytes,2,opt,name=Callee,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Callee"`
	Data                 github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,3,opt,name=Data,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"Data"`
	Value                uint64                                        `protobuf:"varint,4,opt,name=Value,proto3" json:"Value,omitempty"`
	Gas                  uint64                                        `protobuf:"varint,5,opt,name=Gas,proto3" json:"Gas,omitempty"`
}

log event

Log event is used to log in smart contract.

event Transfer(address indexed _from, address indexed _to, uint256 _value);

The number of indexed param is is corresponding to n of LOG(n+1) (underlying EVM opcode). which means that the opcode of Transfer event is LOG3

type LogEvent struct {
	Address              github_com_hyperledger_burrow_crypto.Address   `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"`
	Data                 github_com_hyperledger_burrow_binary.HexBytes  `protobuf:"bytes,2,opt,name=Data,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"Data"`
	Topics               []github_com_hyperledger_burrow_binary.Word256 `protobuf:"bytes,3,rep,name=Topics,proto3,customtype=github.com/hyperledger/burrow/binary.Word256" json:"Topics"`

Data store (abi encoded) data of unIndexed params.

Generally, The length of Topics is corresponding to n of LOGn (underlying EVM opcode), It means that the max length of Topics is 5 and the min is 0.

Topics[0] store the keccak256-hash of this event’s signature If this event is not anonymous.
Others store data of indexed param.
Note:
If indexed param type is all “complex” types or types of dynamic length, including all arrays, string, bytes and structs, Topic store its keccak256-hash of abi encoded value

govern event

type GovernAccountEvent struct {
	AccountUpdate        *spec.TemplateAccount `protobuf:"bytes,1,opt,name=AccountUpdate,proto3" json:"AccountUpdate,omitempty"`
}

type TemplateAccount struct {
	Name             string                                        `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	Address          *github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,2,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:",omitempty" toml:",omitempty"`
	PublicKey        *crypto.PublicKey                             `protobuf:"bytes,3,opt,name=PublicKey,proto3" json:",omitempty" toml:",omitempty"`
	Amounts          []balance.Balance                             `protobuf:"bytes,4,rep,name=Amounts,proto3" json:",omitempty" toml:",omitempty"`
	Permissions      []string                                      `protobuf:"bytes,5,rep,name=Permissions,proto3" json:",omitempty" toml:",omitempty"`
	Roles            []string                                      `protobuf:"bytes,6,rep,name=Roles,proto3" json:",omitempty" toml:",omitempty"`
	Code             *github_com_hyperledger_burrow_acm.Bytecode   `protobuf:"bytes,7,opt,name=Code,proto3,customtype=github.com/hyperledger/burrow/acm.Bytecode" json:"Code,omitempty"`
	XXX_unrecognized []byte                                        `json:"-"`
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
vc++全版本组件大全 VC++运行时(Visual C++ Runtime)是VC++开发环境中用于支持C和C++程序运行的基础库集合。这些库包含了执行C/C++程序所必需的基本函数和数据结构,例如内存管理、字符串操作、输入输出处理、异常处理等。VC++运行时库分为静态库和动态库两种形式,以适应不同类型的项目需求。 静态链接库 vs 动态链接库 静态链接库(Static Linking Libraries):在编译时,静态库的代码会被直接嵌入到最终生成的可执行文件中。这意味着每个使用静态库的程序都会包含库代码的一个副本,导致最终程序的体积较大,但不需要外部库文件支持即可独立运行。在VC++中,静态链接库的例子有LIBC.lib(用于单线程程序)和LIBCMT.lib(用于多线程程序)。 动态链接库(Dynamic Link Libraries):与静态链接相反,动态库的代码并不直接加入到应用程序中,而是在程序运行时被加载。这使得多个程序可以共享同一份库代码,节省了系统资源。VC++的动态运行时库主要通过msvcrt.dll(或其变体,如MSVCRTD.dll用于调试版本)实现,与之配套的导入库(Import Library)如CRTDLL.lib用于链接阶段。 运行时库的版本 VC++运行时库随着Visual Studio版本的更新而发展,每个版本都可能引入新的特性和优化,同时保持向后兼容性。例如,有VC++ 2005、2008、2010直至2019等多个版本的运行时库,每个版本都对应着特定的开发环境和Windows操作系统。 重要性 VC++运行时对于确保程序正确运行至关重要。当程序在没有安装相应运行时库的计算机上执行时,可能会遇到因缺失DLL文件(如MSVCP*.dll, VCRUNTIME*.dll等)而导致的错误。因此,开发完成后,通常需要分发相应的VC++ Redistributable Packages给最终用户安装,以确保程序能够在目标系统上顺利运行。 安装与部署 安装VC++运行时库通常是通过Microsoft提供的Redistributable Packages完成的,这是一个简单的过程,用户只需运行安装程序即可自动安装所需组件。对于开发者而言,了解和管理不同版本的运行时库对于确保应用程序的广泛兼容性和可靠性是必要的。
1444. Elephpotamus Time limit: 0.5 second Memory limit: 64 MB Harry Potter is taking an examination in Care for Magical Creatures. His task is to feed a dwarf elephpotamus. Harry remembers that elephpotamuses are very straightforward and imperturbable. In fact, they are so straightforward that always move along a straight line and they are so imperturbable that only move when attracted by something really tasty. In addition, if an elephpotamus stumbles into a chain of its own footprints, it falls into a stupor and refuses to go anywhere. According to Hagrid, elephpotamuses usually get back home moving along their footprints. This is why they never cross them, otherwise they may get lost. When an elephpotamus sees its footprints, it tries to remember in detail all its movements since leaving home (this is also the reason why they move along straight lines only, this way it is easier to memorize). Basing on this information, the animal calculates in which direction its burrow is situated, then turns and goes straight to it. It takes some (rather large) time for an elephpotamus to perform these calculations. And what some ignoramuses recognize as a stupor is in fact a demonstration of outstanding calculating abilities of this wonderful, though a bit slow-witted creature. Elephpotamuses' favorite dainty is elephant pumpkins, and some of such pumpkins grow on the lawn where Harry is to take his exam. At the start of the exam, Hagrid will drag the elephpotamus to one of the pumpkins. Having fed the animal with a pumpkin, Harry can direct it to any of the remaining pumpkins. In order to pass the exam, Harry must lead the elephpotamus so that it eats as many pumpkins as possible before it comes across its footprints. Input The first input line contains the number of pumpkins on the lawn N (3 ≤ N ≤ 30000). The pumpkins are numbered from 1 to N, the number one being assigned to the pumpkin to which the animal is brought at the start of the trial. In the next N lines, the coordinates of the pumpkins are given in the order corresponding to their numbers. All the coordinates are integers in the range from −1000 to 1000. It is guaranteed that there are no two pumpkins at the same location and there is no straight line passing through all the pumpkins. Output In the first line write the maximal number K of pumpkins that can be fed to the elephpotamus. In the next K lines, output the order in which the animal will eat them, giving one number in a line. The first number in this sequence must always be 1.写一段Java完成此目的
06-03
题目翻译:哈利波特正在参加魔法生物关怀考试,他的任务是喂养一只小矮象河马。小矮象河马非常直接和冷静,只有在被真正美味的东西吸引时才会移动。此外,如果小矮象河马跌入自己的脚印链中,它会陷入昏迷并拒绝前进。根据海格的说法,小矮象河马通常沿着自己的脚印回家。这就是为什么它们从不越过脚印,否则它们可能会迷路。当小矮象河马看到自己的脚印时,它会尽力记住自离家出发以来的所有行动,然后计算出其巢穴的方向,然后转身朝着巢穴直走。一个小矮象河马执行这些计算需要一些时间。而一些无知的人认为这是一种昏迷,实际上这是这种美妙的,虽然有点迟钝的生物出色的计算能力的展示。小矮象河马最喜欢的美食是大象南瓜,而哈利所在的草坪上就有一些这样的南瓜。在考试开始时,海格将小矮象河马拖到其中一只南瓜旁边。喂了小矮象河马一只南瓜后,哈利可以把它引导到剩下的任意一只南瓜。为了通过考试,哈利必须引导小矮象河马尽可能多地吃南瓜,直到它遇到自己的脚印。 输入:第一行包含草坪上南瓜的数量N(3≤N≤30000)。南瓜从1到N编号,数字1被分配给小矮象河马开始时所在的南瓜。在接下来的N行中,按其编号对应的顺序给出南瓜的坐标。所有坐标都是范围从-1000到1000的整数。保证没有两个南瓜在相同的位置,并且没有一条直线穿过所有南瓜。 输出:第一行写出小矮象河马最多可以吃到的南瓜数K。在接下来的K行中,输出小矮象河马将要吃的南瓜的顺序,每行输出一个数字。这个序列中的第一个数字必须始终为1。 解题思路:这道题是一道比较难的贪心算法,需要仔细思考。我们可以先把所有的南瓜按照离开始点的距离排序,然后从第二个南瓜开始遍历,每次找到一个能够吃到的南瓜就将其加入结果中,并更新当前位置和能够到达的最远位置。如果当前位置已经在之前的路径中出现过,那么就不能再继续走了,因为这样会导致小矮象河马迷路。最后输出结果即可。 代码实现:

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值