-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from skilesare/main
Merge changes - Refactor
- Loading branch information
Showing
11 changed files
with
1,483 additions
and
1,209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"canisters": { | ||
|
||
"test_runner": { | ||
"main": "tests/test_runner.mo", | ||
"type": "motoko" | ||
} | ||
}, | ||
"defaults": { | ||
"build": { | ||
"args": "", | ||
"packtool": "vessel sources" | ||
} | ||
}, | ||
"dfx": "0.9.2", | ||
"networks": { | ||
"local": { | ||
"bind": "127.0.0.1:8000", | ||
"type": "ephemeral" | ||
} | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let upstream = https://github.com/dfinity/vessel-package-set/releases/download/mo-0.6.21-20220215/package-set.dhall sha256:b46f30e811fe5085741be01e126629c2a55d4c3d6ebf49408fb3b4a98e37589b | ||
let Package = | ||
{ name : Text, version : Text, repo : Text, dependencies : List Text } | ||
|
||
let | ||
-- This is where you can add your own packages to the package-set | ||
additions = | ||
[] : List Package | ||
|
||
let | ||
{- This is where you can override existing packages in the package-set | ||
For example, if you wanted to use version `v2.0.0` of the foo library: | ||
let overrides = [ | ||
{ name = "foo" | ||
, version = "v2.0.0" | ||
, repo = "https://github.com/bar/foo" | ||
, dependencies = [] : List Text | ||
} | ||
] | ||
-} | ||
overrides = | ||
[] : List Package | ||
|
||
in upstream # additions # overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/////////////////////////////// | ||
// | ||
// ©2021 @aramakme | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
/////////////////////////////// | ||
|
||
|
||
import Types "types"; | ||
import Array "mo:base/Array"; | ||
|
||
module { | ||
|
||
type CandyValue = Types.CandyValue; | ||
type CandyValueUnstable = Types.CandyValueUnstable; | ||
type PropertyUnstable = Types.PropertyUnstable; | ||
|
||
|
||
public func cloneValueUnstable(val : CandyValueUnstable) : CandyValueUnstable{ | ||
switch(val){ | ||
case(#Class(val)){ | ||
|
||
return #Class(Array.tabulate<PropertyUnstable>(val.size(), func(idx){ | ||
{name= val[idx].name; value=cloneValueUnstable(val[idx].value); immutable = val[idx].immutable}; | ||
})); | ||
}; | ||
case(#Bytes(val)){ | ||
switch(val){ | ||
case(#frozen(val)){ | ||
|
||
#Bytes(#frozen(val)); | ||
}; | ||
case(#thawed(val)){ | ||
|
||
#Bytes(#thawed(val.clone())); | ||
}; | ||
} | ||
}; | ||
case(_){ | ||
|
||
val; | ||
} | ||
}; | ||
}; | ||
|
||
} |
Oops, something went wrong.