Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public void testClassifiedListingTagSerializer() throws JsonProcessingException

GenericEvent event = new GenericEventDecoder<>().decode(classifiedListingEventJson);
EventMessage message = NIP01.createEventMessage(event, "1");
assertEquals(1, message.getNip());
assertEquals("1", message.getNip());
String encoded = new BaseEventEncoder<>((BaseEvent) message.getEvent()).encode();
assertEquals(
"{\"id\":\"28f2fc030e335d061f0b9d03ce0e2c7d1253e6fadb15d89bd47379a96b2c861a\",\"kind\":30402,\"content\":\"content"
Expand Down
4 changes: 2 additions & 2 deletions nostr-java-base/src/main/java/nostr/base/IElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
public interface IElement {

default Integer getNip() {
return 1;
default String getNip() {
return "1";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class GenericEvent extends BaseEvent implements ISignable, Deleteable {

@JsonIgnore @EqualsAndHashCode.Exclude private byte[] _serializedEvent;

@JsonIgnore @EqualsAndHashCode.Exclude private Integer nip;
@JsonIgnore @EqualsAndHashCode.Exclude private String nip;

public GenericEvent() {
this.tags = new ArrayList<>();
Expand Down Expand Up @@ -322,7 +322,7 @@ public static class GenericEventBuilder {
private String content = "";
private Long createdAt;
private Signature signature;
private Integer nip;
private String nip;

public GenericEventBuilder id(String id) { this.id = id; return this; }
public GenericEventBuilder pubKey(PublicKey pubKey) { this.pubKey = pubKey; return this; }
Expand All @@ -332,7 +332,7 @@ public static class GenericEventBuilder {
public GenericEventBuilder content(String content) { this.content = content; return this; }
public GenericEventBuilder createdAt(Long createdAt) { this.createdAt = createdAt; return this; }
public GenericEventBuilder signature(Signature signature) { this.signature = signature; return this; }
public GenericEventBuilder nip(Integer nip) { this.nip = nip; return this; }
public GenericEventBuilder nip(String nip) { this.nip = nip; return this; }

public GenericEvent build() {
GenericEvent event = new GenericEvent();
Expand Down Expand Up @@ -498,11 +498,11 @@ protected void addStandardTag(BaseTag tag) {
Optional.ofNullable(tag).ifPresent(this::addTag);
}

protected void addGenericTag(String key, Integer nip, Object value) {
protected void addGenericTag(String key, String nip, Object value) {
Optional.ofNullable(value).ifPresent(s -> addTag(BaseTag.create(key, s.toString())));
}

protected void addStringListTag(String label, Integer nip, List<String> tag) {
protected void addStringListTag(String label, String nip, List<String> tag) {
Optional.ofNullable(tag).ifPresent(tagList -> BaseTag.create(label, tagList));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public BaseAuthMessage(String command) {
}

@Override
public Integer getNip() {
return 42;
public String getNip() {
return "42";
}
}