-
Notifications
You must be signed in to change notification settings - Fork 12
Description
下面的合约应该是合法的(参考https://liquid-doc.readthedocs.io/zh_CN/latest/docs/contract/method.html):

实际编译报错:
error[E0428]: the name __LIQUID_EXTERNAL_INPUT_CHECKER_1746386959 is defined multiple times
--> E:\101_code\hello_world\src\lib.rs:6:1
|
6 | #[liquid::contract]
| ^^^^^^^^^^^^^^^^^^^ __LIQUID_EXTERNAL_INPUT_CHECKER_1746386959 redefined here
|
= note: __LIQUID_EXTERNAL_INPUT_CHECKER_1746386959 must be defined only once in the type namespace of this block
= note: this error originates in the attribute macro liquid::contract (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait FnOutput for type FnMarker<[(); 1746386959]>
--> E:\101_code\hello_world\src\lib.rs:28:30
|
23 | pub fn get(&self) -> String {
| ------ first implementation here
...
28 | pub fn get(&self) -> Address {
| ^^^^^^^ conflicting implementation for FnMarker<[(); 1746386959]>
error[E0119]: conflicting implementations of trait FnSelector for type FnMarker<[(); 1746386959]>
--> E:\101_code\hello_world\src\lib.rs:6:1
合约方法的签名ID不应该对方法名称“get”进行hash取前4字节来计算,应该调整为“get()->String"或者”get()->Address"。