Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: fungible token #14

Merged
merged 53 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
143e32f
example: fungible token
petersalomonsen Apr 25, 2023
aa72354
devcontainer setup
petersalomonsen Sep 29, 2024
dcc3746
install wasm32-wasip1 target in devcontainer
petersalomonsen Sep 30, 2024
bb4525d
remove mutex / once from testenv. remove lazy_static
petersalomonsen Sep 30, 2024
99b6ed9
unittest pass in 1.81.0 by removing printf
petersalomonsen Oct 1, 2024
33ec374
rustup target add wasm32-wasip1
petersalomonsen Oct 1, 2024
8de0569
quickjs-2024-01-13
petersalomonsen Oct 4, 2024
7592377
install wabt in pipeline
petersalomonsen Oct 4, 2024
107c2c9
install emscripten
petersalomonsen Oct 5, 2024
043174d
remove static lib binaries
petersalomonsen Oct 5, 2024
e7dbaed
install binaryen
petersalomonsen Oct 5, 2024
7626d37
emscripten lib search dir
petersalomonsen Oct 5, 2024
1ec2c8f
common install dependencies script
petersalomonsen Oct 5, 2024
63e99ac
wasmtime must be in path
petersalomonsen Oct 5, 2024
0acd5d8
organize pipeline better
petersalomonsen Oct 5, 2024
667ac4a
wasip1 target for all unit tests
petersalomonsen Oct 5, 2024
01b0d73
wasip1 target
petersalomonsen Oct 5, 2024
25f2061
fix rust setup
petersalomonsen Oct 5, 2024
93e5b17
caused error
petersalomonsen Oct 5, 2024
d402e59
env not working
petersalomonsen Oct 5, 2024
1ac69f8
add environment in the end
petersalomonsen Oct 5, 2024
ccc9464
restore emsdk, wabt and quickjs from cache
petersalomonsen Oct 5, 2024
b9cd8f4
fix paths
petersalomonsen Oct 5, 2024
d2828cb
test path
petersalomonsen Oct 5, 2024
af05122
include binaryen in cache
petersalomonsen Oct 5, 2024
8314e48
add wasm32-unknown-unknown
petersalomonsen Oct 5, 2024
f6dd5d0
install node modules
petersalomonsen Oct 5, 2024
2d4d9d6
add wasi_clock_time_get to wasimock
petersalomonsen Oct 6, 2024
e9383c0
node 20
petersalomonsen Oct 6, 2024
e36365c
build wasmlib
petersalomonsen Oct 7, 2024
4ec9cc1
quickjslib tests
petersalomonsen Oct 7, 2024
8b5ed97
Don't create runtime automatically
petersalomonsen Oct 7, 2024
2d1dbf0
quickjslib should call init
petersalomonsen Oct 7, 2024
cb13112
no debug, create runtime for jslib
petersalomonsen Oct 7, 2024
47a350e
no need to create runtime, as it already happens when loading bydecode
petersalomonsen Oct 7, 2024
a433c53
use standard quickjs context
petersalomonsen Oct 7, 2024
836cd6f
block_timestamp must be bigint nanosecs
petersalomonsen Oct 7, 2024
6218bfb
unused import
petersalomonsen Oct 7, 2024
8496576
fix wabt build
petersalomonsen Oct 7, 2024
650b19b
yarn install in all tests
petersalomonsen Oct 7, 2024
fe81e58
remove old quickjsbytecode binary, compile on each test instead
petersalomonsen Oct 8, 2024
555749d
debug pipeline whereis wasm2wat
petersalomonsen Oct 8, 2024
4d39861
list content of wabt bin
petersalomonsen Oct 8, 2024
676b11a
hashfiles should match install-dependencies.sh and yarn.lock
petersalomonsen Oct 8, 2024
93e9ac4
clean up path tests from action
petersalomonsen Oct 8, 2024
315faab
setup new testenv for every test function
petersalomonsen Oct 8, 2024
e8c7e40
javascript in ft contract
petersalomonsen Oct 8, 2024
c1c5dcc
check balance function in ft
petersalomonsen Oct 8, 2024
0ad966a
transfer
petersalomonsen Oct 9, 2024
99bcbe2
ft transfer a specific amonut
petersalomonsen Oct 9, 2024
89b3c3b
transfer with custom data
petersalomonsen Oct 9, 2024
36c377c
fungible token contract e2e test
petersalomonsen Oct 9, 2024
750a297
add README
petersalomonsen Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"postCreateCommand": "./.devcontainer/post-create.sh",
"features": {
"ghcr.io/devcontainers/features/rust:1": {},
"ghcr.io/near/near-devcontainers/features/cargo-near:latest": {},
"ghcr.io/near/near-devcontainers/features/near-cli:latest": {},
"ghcr.io/devcontainers-community/features/llvm": {}
},
"customizations": {
"vscode": {
"extensions": ["dtsvet.vscode-wasm", "rust-lang.rust-analyzer"]
"extensions": [
"dtsvet.vscode-wasm",
"rust-lang.rust-analyzer",
"github.vscode-github-actions",
"vadimcn.vscode-lldb",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.makefile-tools"
]
}
}
},
"postCreateCommand": "./.devcontainer/install-dependencies.sh"
}
39 changes: 39 additions & 0 deletions .devcontainer/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

yarn install

# Install Rust targets
rustup target add wasm32-unknown-unknown
rustup target add wasm32-wasip1

# Install Binaryen
wget https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xvzf binaryen-version_116-x86_64-linux.tar.gz
echo 'export PATH="$(pwd)/binaryen-version_116/bin:$PATH"' >> ~/.bashrc

# Install Wasmtime
curl https://wasmtime.dev/install.sh -sSf | bash
echo 'export PATH="$HOME/.wasmtime/bin:$PATH"' >> ~/.bashrc

# Install QuickJS
wget https://bellard.org/quickjs/quickjs-2024-01-13.tar.xz
tar -xf quickjs-2024-01-13.tar.xz
rm quickjs-2024-01-13.tar.xz

# Install WABT (WebAssembly Binary Toolkit)
wget https://github.com/WebAssembly/wabt/releases/download/1.0.35/wabt-1.0.35.tar.xz
tar -xvf wabt-1.0.35.tar.xz
cd wabt-1.0.35
mkdir build
cd build
cmake ..
cmake --build .
cd ../..
echo 'export PATH="$(pwd)/wabt-1.0.35/bin:$PATH"' >> ~/.bashrc

# Install Emscripten
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
cd ..
23 changes: 0 additions & 23 deletions .devcontainer/post-create.sh

This file was deleted.

Loading
Loading