mirror of
https://github.com/fluencelabs/examples
synced 2025-06-03 13:11:21 +00:00
fixed issues
This commit is contained in:
parent
c546db1f79
commit
eb9470f23a
@ -14,3 +14,6 @@ path = "src/main.rs"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
fluence = "0.6.9"
|
fluence = "0.6.9"
|
||||||
ethnum = "1.0.3"
|
ethnum = "1.0.3"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
fluence-test = "0.1.9"
|
@ -1,5 +1,10 @@
|
|||||||
|
|
||||||
|
Check:
|
||||||
```
|
```
|
||||||
fldist upload --path artifacts/math.wasm --env testnet --name math
|
./build.sh; cargo test --release;
|
||||||
|
```
|
||||||
|
|
||||||
|
Deploy:
|
||||||
|
```
|
||||||
|
fldist upload --path artifacts/math.wasm --name math --env FLUENCE_ENV
|
||||||
```
|
```
|
@ -6,5 +6,5 @@ cargo update
|
|||||||
marine build --release
|
marine build --release
|
||||||
|
|
||||||
rm -f -r artifacts/*
|
rm -f -r artifacts/*
|
||||||
mkdir artifacts
|
mkdir --parents artifacts
|
||||||
cp target/wasm32-wasi/release/math.wasm artifacts/
|
cp target/wasm32-wasi/release/math.wasm artifacts/
|
||||||
|
@ -39,7 +39,7 @@ pub fn add_u256(number_1: String, number_2: String) -> String {
|
|||||||
return "Overflow".to_string();
|
return "Overflow".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
"InputNonANumber".to_string()
|
"InputNonAU256Number".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[marine]
|
#[marine]
|
||||||
@ -55,7 +55,7 @@ pub fn sub_u256(number_1: String, number_2: String) -> String {
|
|||||||
return "Underflow".to_string();
|
return "Underflow".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
"InputNonANumber".to_string()
|
"InputNonAU256Number".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[marine]
|
#[marine]
|
||||||
@ -71,7 +71,7 @@ pub fn mul_u256(number_1: String, number_2: String) -> String {
|
|||||||
return "Overflow".to_string();
|
return "Overflow".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
"InputNonANumber".to_string()
|
"InputNonAU256Number".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[marine]
|
#[marine]
|
||||||
@ -87,12 +87,13 @@ pub fn div_u256(number_1: String, number_2: String) -> String {
|
|||||||
return "DivisionByZero".to_string();
|
return "DivisionByZero".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
"InputNonANumber".to_string()
|
"InputNonAU256Number".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
#[test]
|
use fluence_test::marine_test;
|
||||||
|
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts/")]
|
||||||
fn add_u256() {
|
fn add_u256() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
super::add_u256(
|
super::add_u256(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user