1 Star 0 Fork 0

李佳柠/Business flow verification

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tra_test.go 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
lemon-ljn 提交于 2024-12-11 21:44 . Update submodule content
package main
import (
"testing"
)
func TestNewTraMessage(t *testing.T) {
t1 := NewTransaction("127.2.1.1", "127.1.0.0", "80","403","ababab")
t2 := NewTransaction("127.3.1.1", "127.5.255.0", "80","403","ababab")
t3 := NewTransaction("127.4.1.1", "127.6.0.255", "8080","403","ababab")
m1 := NewTraMessage(t1.traString())
m2 := NewTraMessage(t2.traString())
m3 := NewTraMessage(t3.traString())
//交易密封
m1.seal()
//交易哈希只有密封之后才能link
m2.link(*m1)
m2.seal()
m3.link(*m2)
m3.seal()
//print(m1.tmsgString())
//print(m2.tmsgString())
//print(m3.tmsgString())
m1.validate()
m2.validate()
m3.validate()
//篡改数据
//m3.data = "hahahaha"
//
//print(m3)
//m3.validate()
}
func TestTransaction_TraJoin(t *testing.T) {
//n := NewNode("addr","mac","N0")
//t1 := NewTransaction("127.2.1.1", "127.1.0.0", "80","403","ababab")
//msg := n.TraJoin(t1)
//fmt.Println(msg)
//b := n.VeriTra(msg)
//fmt.Println(b)
}
//func TestNewID(t *testing.T) {
// n := new(node)
// for i := 0; i<10; i++ {
// //log.Println(time.Now())
// log.Println(n.NewID())
// }
//}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lemon-ljn/business-flow-verification.git
[email protected]:lemon-ljn/business-flow-verification.git
lemon-ljn
business-flow-verification
Business flow verification
master

搜索帮助